/* Mobile first. Brand tokens from the existing Nuvei docs site. */
:root {
  --navy: #160850; --blue: #0c98d4; --bg: #faf9f8; --panel: #ffffff; --ink: #1b1630; --muted: #5d5a70; --line: #e3e0ea;
  --code-bg: #f1eff7; --ok: #0b7a4b; --warn: #a15c00; --bad: #b3261e; --chip: #ece9f5; --radius: 10px;
  --font: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif; --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}
:root[data-theme="dark"] { --bg: #0f0b24; --panel: #17123a; --ink: #f1eff8; --muted: #a9a4c4; --line: #2c2658; --code-bg: #211a4d; --chip: #251e55; --ok: #5fd3a0; --warn: #f0b354; --bad: #ff8a80; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bg: #0f0b24; --panel: #17123a; --ink: #f1eff8; --muted: #a9a4c4; --line: #2c2658; --code-bg: #211a4d; --chip: #251e55; --ok: #5fd3a0; --warn: #f0b354; --bad: #ff8a80; } }
* { box-sizing: border-box; }
html { scroll-padding-top: 72px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); }
a { color: var(--blue); text-decoration: none; } a:hover { text-decoration: underline; }
code, pre, .mono { font-family: var(--mono); font-size: .86em; }
code { background: var(--code-bg); padding: .1em .35em; border-radius: 5px; overflow-wrap: anywhere; }
pre { background: var(--code-bg); padding: 12px; border-radius: 8px; overflow: auto; margin: 8px 0; } pre code { background: none; padding: 0; }
.muted { color: var(--muted); } .pad { padding: 16px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: var(--navy); color: #fff; }
.brand { display: flex; flex-direction: column; line-height: 1.1; color: #fff; margin-right: auto; } .brand:hover { text-decoration: none; }
.brand .mark { font-weight: 700; } .brand .sub { font-size: .75rem; opacity: .8; }
.icon { background: none; border: 1px solid rgba(255,255,255,.35); color: #fff; border-radius: 8px; min-width: 40px; min-height: 40px; font-size: 1.05rem; cursor: pointer; }
#nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--navy); padding: 8px 16px 14px; flex-direction: column; gap: 2px; }
#nav.open { display: flex; }
#nav a { color: #fff; padding: 10px 8px; border-radius: 8px; } #nav a[aria-current="page"] { background: rgba(255,255,255,.14); }

main { max-width: 1180px; margin: 0 auto; padding: 16px; min-height: 70vh; }
h1 { font-size: 1.55rem; line-height: 1.2; margin: 6px 0 4px; } h2 { font-size: 1.2rem; margin: 22px 0 8px; } h3 { font-size: 1.02rem; margin: 16px 0 6px; }
.lead { color: var(--muted); margin: 0 0 14px; max-width: 70ch; }
.foot { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 18px 16px 28px; color: var(--muted); font-size: .82rem; max-width: 1180px; margin: 0 auto; }

.tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; }
.tools input[type="search"], .tools select { flex: 1 1 200px; min-height: 42px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); font: inherit; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip, button.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; background: var(--chip); color: var(--ink); font-size: .78rem; border: 1px solid transparent; }
button.chip { cursor: pointer; min-height: 34px; font: inherit; font-size: .85rem; } button.chip[aria-pressed="true"] { background: var(--navy); color: #fff; }
.badge { font: 600 .7rem var(--mono); padding: 2px 6px; border-radius: 5px; background: var(--chip); letter-spacing: .02em; }
.m-GET { background: #dff3e8; color: #0b5e3a; } .m-POST { background: #dcebfb; color: #0b4a86; } .m-PUT { background: #fbeed6; color: #7a4a00; } .m-DELETE { background: #fbe0de; color: #8e1c16; }
.ok { color: var(--ok); } .warn { color: var(--warn); } .bad { color: var(--bad); }

.grid { display: grid; gap: 10px; grid-template-columns: 1fr; }
.card { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; color: inherit; }
.card:hover { border-color: var(--blue); text-decoration: none; }
.card h3 { margin: 4px 0 4px; font-size: 1rem; } .card p { margin: 0; color: var(--muted); font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; } .card .path { font: .8rem var(--mono); overflow-wrap: anywhere; }
.group-title { margin: 20px 0 8px; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

/* Quickstart */
.qs { display: grid; gap: 16px; }
.qs-nav { display: none; }
details.part { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; }
details.part > summary { cursor: pointer; padding: 14px 16px; font-weight: 600; list-style: none; display: flex; gap: 10px; align-items: baseline; }
details.part > summary::-webkit-details-marker { display: none; }
details.part > summary .n { font: 600 .72rem var(--mono); color: var(--blue); white-space: nowrap; }
details.part[open] > summary { border-bottom: 1px solid var(--line); }
.part-body { padding: 6px 16px 14px; }
.blk { position: relative; padding: 6px 0; border-bottom: 1px dashed var(--line); } .blk:last-child { border-bottom: 0; }
.blk .link { float: right; font-size: .78rem; opacity: .7; margin-left: 8px; }
.blk table, .prose table { border-collapse: collapse; width: 100%; font-size: .9rem; display: block; overflow-x: auto; }
.blk th, .blk td, .prose th, .prose td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.blk img, .prose img { max-width: 100%; height: auto; }
.blk ul, .blk ol { padding-left: 22px; }
.tip, .blk .npmw-note, .blk .callout, .blk .action-item { background: var(--code-bg); border-left: 3px solid var(--blue); padding: 8px 12px; border-radius: 6px; margin: 8px 0; }
.blk .action-label { font-weight: 700; margin-right: 4px; }
.blk .json-desc { color: var(--muted); font-size: .9rem; }
.diagram { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px; } .diagram svg { max-width: 100%; height: auto; }

/* Modal */
dialog { width: min(920px, 100vw); max-width: 100vw; max-height: 100dvh; height: 100dvh; margin: 0 0 0 auto; border: 0; padding: 0; background: var(--bg); color: var(--ink); }
dialog::backdrop { background: rgba(10, 6, 40, .55); }
.m-head { position: sticky; top: 0; background: var(--panel); border-bottom: 1px solid var(--line); padding: 12px 16px; display: flex; gap: 10px; align-items: flex-start; z-index: 2; }
.m-head h2 { margin: 2px 0 0; font-size: 1.15rem; flex: 1; } .m-body { padding: 14px 16px 40px; }
.btn { min-height: 38px; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: inherit; font-size: .88rem; cursor: pointer; } .btn:hover { border-color: var(--blue); }
.endpoint-line { font: 600 .95rem var(--mono); overflow-wrap: anywhere; margin: 4px 0 10px; }
details.variant { border: 1px solid var(--line); border-radius: 8px; margin: 8px 0; background: var(--panel); }
details.variant > summary { cursor: pointer; padding: 10px 12px; font-weight: 600; } details.variant > div { padding: 0 12px 12px; }
table.kv { border-collapse: collapse; width: 100%; font-size: .9rem; } table.kv th, table.kv td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; } table.kv th { color: var(--muted); font-weight: 600; }
.scroll-x { overflow-x: auto; }

@media (min-width: 720px) {
  .grid { grid-template-columns: repeat(2, 1fr); } main { padding: 22px 24px; } h1 { font-size: 1.9rem; }
  #menu { display: none; } #nav { display: flex; position: static; flex-direction: row; padding: 0; gap: 4px; background: none; margin-right: 8px; } #nav a { padding: 8px 12px; }
  .brand { margin-right: 18px; } .top { gap: 12px; } #nav { margin-left: auto; } .brand { margin-right: 0; }
}
@media (min-width: 1040px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .qs { grid-template-columns: 250px minmax(0, 1fr); align-items: start; }
  .qs-nav { display: block; position: sticky; top: 76px; font-size: .9rem; } .qs-nav a { display: block; padding: 6px 8px; border-radius: 6px; color: var(--ink); } .qs-nav a:hover { background: var(--chip); text-decoration: none; }
  .qs-nav .n { font: 600 .7rem var(--mono); color: var(--blue); margin-right: 6px; }
}

/* Quickstart content keeps the class names of the page it was cut from; these give them a home here. */
.blk .accordion { border: 1px solid var(--line); border-radius: 8px; margin: 10px 0; overflow: hidden; }
.blk .accordion-header { background: var(--chip); padding: 8px 12px; font-weight: 600; }
.blk .accordion-content { padding: 4px 12px 8px; }
.blk .json-row { display: grid; grid-template-columns: 1fr; gap: 2px 14px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.blk .json-row:last-child { border-bottom: 0; }
.blk .json-keyval, .blk .closing-brace, .blk .code2 { font: .84rem var(--mono); overflow-wrap: anywhere; }
.blk .ui-impact { color: var(--blue); font-size: .82rem; }
.blk .intro-card, .blk .headers-card, .blk .gateway-doc, .blk .certification-note { background: var(--code-bg); border-radius: 8px; padding: 10px 12px; margin: 8px 0; }
.blk .pitfalls { border-left: 3px solid var(--warn); background: var(--code-bg); padding: 8px 12px; border-radius: 6px; margin: 8px 0; }
.blk .npmw-steps { padding-left: 22px; } .blk .npmw-steps li { margin: 6px 0; }
.blk svg { max-width: 100%; height: auto; }
@media (min-width: 720px) { .blk .json-row { grid-template-columns: minmax(200px, 36%) 1fr; } }
/* The old page tuned list spacing with negative inline margins that only worked in its own layout. */
.blk [style*="margin-bottom:-"], .blk [style*="margin-bottom: -"] { margin-bottom: 0 !important; }
.blk li { margin: 4px 0; }

/* Try it on the sandbox */
.try { border: 1px dashed var(--line); border-radius: 8px; padding: 10px 12px; margin: 8px 0; }
.fld { display: block; font-size: .82rem; color: var(--muted); margin: 6px 0; }
.fld input, .fld textarea { display: block; width: 100%; margin-top: 3px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); font: .84rem var(--mono); }
.btn.primary { background: var(--navy); color: #fff; border-color: var(--navy); } .btn[disabled] { opacity: .6; cursor: progress; }
:root[data-theme="dark"] .btn.primary { background: var(--blue); border-color: var(--blue); }

/* Hosted UI Studio */
main.wide { max-width: 1640px; }
.studio { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 12px 14px; margin: 10px 0; }
.st-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; } .st-sp { flex: 1; }
a.btn { display: inline-flex; align-items: center; } a.btn:hover { text-decoration: none; }
a.chip.st-tab { min-height: 34px; font-size: .85rem; padding: 3px 12px; } a.chip.st-tab:hover { text-decoration: none; border-color: var(--blue); } a.chip.st-tab[aria-current="page"] { background: var(--navy); color: #fff; }
.st-cols { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.st-col { min-width: 0; } .st-col h3 { margin: 6px 0 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.st-small { font-size: .82rem; margin: 6px 0; }
.st-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fld select { display: block; width: 100%; margin-top: 3px; min-height: 42px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); font: inherit; font-size: .9rem; }
.st-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.st-group > div { display: grid; gap: 8px; padding-top: 4px; }
.st-f { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 6px; align-items: center; font-size: .86rem; }
.st-f > label { color: var(--muted); font: .8rem var(--mono); overflow-wrap: anywhere; }
.st-f > input { grid-column: 1 / -1; width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); font: .84rem var(--mono); }
.st-f > .st-chk { display: flex; align-items: center; gap: 8px; min-height: 36px; cursor: pointer; color: var(--ink); } .st-chk input { width: 18px; height: 18px; flex: none; }
.st-i { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--muted); font: 600 .78rem var(--font); cursor: pointer; }
.st-hint { grid-column: 1 / -1; background: var(--code-bg); border-left: 3px solid var(--blue); border-radius: 6px; padding: 6px 10px; font-size: .84rem; }
.studio textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); font: .82rem var(--mono); }
/* The hosted page is a light page whatever this site's theme. */
.st-stage { border: 1px solid var(--line); border-radius: 8px; background: #fff; color: #5d5a70; min-height: 160px; overflow: hidden; resize: vertical; }
.st-stage:has(iframe) { height: 700px; } .st-stage iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.st-empty { padding: 18px 14px; margin: 0; } .st-stage .st-empty { color: #5d5a70; }
.st-log { max-height: 520px; overflow: auto; }
.st-ev { border-bottom: 1px solid var(--line); padding: 6px 0; font-size: .86rem; overflow-wrap: anywhere; } .st-ev pre { max-height: 260px; }
/* Two columns: the request runs down the left; the extra height goes to the log row, not to a gap under the page. */
@media (min-width: 860px) { .st-cols { grid-template-columns: minmax(300px, 5fr) minmax(0, 7fr); grid-template-rows: auto 1fr; } .st-req { grid-row: span 2; } }
@media (min-width: 1280px) {
  .studio.full .st-cols { grid-template-columns: minmax(320px, 400px) minmax(0, 1fr) minmax(300px, 420px); grid-template-rows: auto; align-items: start; } .studio.full .st-req { grid-row: auto; }
  .studio.full .st-req, .studio.full .st-logcol { max-height: calc(100dvh - 150px); overflow: auto; position: sticky; top: 72px; } .studio.full .st-log { max-height: none; }
}

/* Own credentials */
.cred { margin: 6px 0 10px; } .cred-now { margin: 4px 0; font-size: .86rem; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cred .st-f { margin: 6px 0; } .cred .st-hint { border-left: 0; background: none; padding: 0; color: var(--muted); }
/* Masked while typed, but not a password field: the browser must not offer to save it. */
input.secret { -webkit-text-security: disc; }
.chip.warn { color: var(--warn); border-color: currentColor; background: transparent; }

/* ---- the workspace: who is signed in, your setup, myCollection, the certification quickstart */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.who { display: flex; align-items: center; gap: 6px; }
.icon.text { width: auto; padding: 0 12px; font: inherit; font-size: .88rem; display: inline-flex; align-items: center; gap: 6px; color: #fff; text-decoration: none; }
.icon.text.solid { background: var(--blue); border-color: var(--blue); }
.icon .count { background: rgba(255,255,255,.2); border-radius: 999px; padding: 0 7px; font-size: .78rem; }
.menu { position: relative; } .menu summary { list-style: none; cursor: pointer; color: #fff; border: 1px solid rgba(255,255,255,.35); border-radius: 8px; min-height: 40px; padding: 0 12px; display: inline-flex; align-items: center; font-size: .88rem; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu summary::-webkit-details-marker { display: none; } .menu summary::after { content: "▾"; margin-left: 6px; opacity: .8; }
.menu-list { position: absolute; right: 0; top: calc(100% + 6px); min-width: 210px; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 6px; display: flex; flex-direction: column; box-shadow: 0 10px 30px rgba(10,6,40,.25); z-index: 30; }
.menu-list a { color: var(--ink); padding: 10px 10px; border-radius: 8px; } .menu-list a:hover { background: var(--chip); text-decoration: none; }
.setup { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 8px 16px; background: var(--panel); border-bottom: 1px solid var(--line); font-size: .86rem; }
.setup-label { font-weight: 700; } .setup label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.setup select { min-height: 38px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); font: inherit; max-width: 60vw; }
.setup-note { color: var(--muted); flex: 1 1 220px; } .bad { color: var(--bad); }
.card-wrap { position: relative; display: flex; } .card-wrap > .card { flex: 1; padding-right: 48px; }
.collect { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font-size: 1rem; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.collect:hover { border-color: var(--blue); text-decoration: none; } .collect[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); color: #fff; }
.blk { position: relative; } .collect.inline { top: 0; right: 28px; width: 28px; height: 28px; font-size: .9rem; opacity: .75; } .collect.inline:hover, .collect.inline[aria-pressed="true"] { opacity: 1; }
.btn.collect-wide { position: static; width: auto; height: auto; border-radius: 8px; padding: 6px 12px; font-size: .95rem; } .btn.collect-wide[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); color: #fff; }
.card.locked { opacity: .72; border-style: dashed; } .card.locked h3 { color: var(--muted); }
.pane { position: fixed; right: 0; top: 60px; bottom: 0; width: min(360px, 92vw); background: var(--panel); border-left: 1px solid var(--line); box-shadow: -10px 0 30px rgba(10,6,40,.18); z-index: 15; padding: 12px 14px; overflow: auto; }
.pane-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.pane-list { margin: 0; padding-left: 20px; } .pane-list li { padding: 6px 0; border-bottom: 1px solid var(--line); } .pane-list li a { margin-right: 6px; }
.pane-list .x, .ws-tools .x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: .9rem; padding: 4px 6px; } .pane-foot { margin-top: 14px; }
.ws-sec { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 14px 0; } .ws-sec h2 { margin: 0 0 6px; font-size: 1.1rem; }
.ws-cert { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); } .ws-cert:first-of-type { border-top: 0; } .ws-cert > div { flex: 1 1 260px; }
.meter { height: 8px; border-radius: 999px; background: var(--chip); overflow: hidden; margin: 8px 0 4px; } .meter span { display: block; height: 100%; background: var(--ok); }
.board { margin: 16px 0 6px; font-size: .95rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.ws-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; } .ws-item { display: grid; gap: 8px; grid-template-columns: 1fr; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; background: var(--bg); }
.ws-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; } .ws-tools .fld { margin: 0; flex: 0 1 180px; } .ws-tools .fld.grow { flex: 1 1 260px; }
.steps { list-style: none; margin: 16px 0; padding: 0; display: grid; gap: 12px; }
.step { display: grid; grid-template-columns: 40px 1fr; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; } .step.done { opacity: .8; }
.step-n { width: 36px; height: 36px; border-radius: 999px; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; } .step.done .step-n { background: var(--ok); }
.step-body h3 { margin: 6px 0; font-size: 1.05rem; } .step-body .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip.bad { color: var(--bad); border-color: currentColor; background: transparent; } .bad-tip { border-left-color: var(--bad); }
form.result { border-top: 1px dashed var(--line); margin-top: 10px; padding-top: 8px; } .actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
a.chip[aria-pressed="true"] { background: var(--navy); color: #fff; }
@media (min-width: 900px) { .ws-item { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .pane { top: 62px; } }
/* The header holds more now: links never break in two, and the sections fold into the menu button sooner. */
#nav a, .icon.text, .menu summary { white-space: nowrap; }
@media (max-width: 1239px) { #nav { display: none !important; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; margin: 0; } #nav.open { display: flex !important; } #menu { display: inline-flex !important; align-items: center; justify-content: center; } }
@media (max-width: 520px) { .who .icon.text { padding: 0 8px; } .menu summary { max-width: 32vw; } }
