/* MOFA Data API: site and console styles. Calm, warm, concise. */

:root {
  --bg: #FAF9F5;
  --bg-alt: #F3F1EA;
  --surface: #FFFFFF;
  --text: #1F1E1D;
  --muted: #6B6A63;
  --border: #E8E6DC;
  --border-strong: #D6D3C7;
  --code-bg: #F0EEE6;
  --accent: #C96442;
  --accent-ink: #A9502F;
  --accent-soft: #F6E9E2;
  --ok: #2F6B45;
  --ok-soft: #E6F0E8;
  --danger: #B3261E;
  --danger-soft: #FBEAE8;
  --warn-soft: #FBF3E1;
  --radius: 8px;
  --radius-sm: 6px;
  --serif: Georgia, "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", "Noto Sans Mono CJK SC", monospace;
  --header-h: 60px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main { flex: 1 0 auto; outline: none; }
img, svg { max-width: 100%; }
[hidden] { display: none !important; }

a { color: var(--accent-ink); text-decoration: underline; text-decoration-color: rgba(169, 80, 47, .35); text-underline-offset: 2px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent-soft); }

h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.25; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.3em; }
code, pre, kbd { font-family: var(--mono); }
code { font-size: .88em; background: var(--code-bg); padding: .12em .36em; border-radius: 4px; overflow-wrap: break-word; }
pre { margin: 0; overflow: auto; font-size: 13px; line-height: 1.6; }
pre code { background: none; padding: 0; font-size: inherit; overflow-wrap: normal; white-space: pre; }
hr { border: 0; border-top: 1px solid var(--border); margin: 32px 0; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 760px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 13px; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.accent-ink { color: var(--accent-ink); }
.wrap-any { overflow-wrap: anywhere; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 50; background: var(--text); color: var(--bg); padding: 8px 12px; border-radius: var(--radius-sm); text-decoration: none; }
.skip-link:focus { top: 10px; }

/* ------------------------------------------------------------ type */
.display { font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 4.6vw, 54px); line-height: 1.12; letter-spacing: -.01em; }
.display-sm { font-family: var(--serif); font-weight: 400; font-size: clamp(28px, 3.4vw, 38px); line-height: 1.18; letter-spacing: -.005em; margin-bottom: 12px; }
.h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(24px, 2.6vw, 30px); line-height: 1.25; margin-bottom: 16px; }
.h3 { font-size: 17px; margin-bottom: 12px; }
.h4 { font-size: 15px; margin: 24px 0 10px; }
.lede { font-size: 18px; color: var(--muted); max-width: 680px; margin: 16px 0 0; }
.eyebrow { font-size: 13px; color: var(--muted); letter-spacing: .02em; margin-bottom: 6px; }

/* ------------------------------------------------------------ header */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(250, 249, 245, .96); border-bottom: 1px solid var(--border); }
@supports (backdrop-filter: blur(6px)) { .site-header { background: rgba(250, 249, 245, .86); backdrop-filter: blur(8px); } }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 600; letter-spacing: -.005em; white-space: nowrap; }
.brand .mark { width: 26px; height: 26px; flex: none; }
.brand-name { font-size: 16px; }
.brand-sub { font-weight: 400; color: var(--muted); }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a { color: var(--text); text-decoration: none; font-size: 15px; padding: 6px 10px; border-radius: var(--radius-sm); white-space: nowrap; }
.site-nav a:hover { background: var(--bg-alt); }
.site-nav a[aria-current="page"] { color: var(--accent-ink); }
.site-nav .nav-cta { border: 1px solid var(--border-strong); background: var(--surface); margin-left: 4px; }
.site-nav .nav-cta:hover { border-color: var(--text); background: var(--surface); }
.site-nav .lang-switch { color: var(--muted); font-size: 14px; }

/* ------------------------------------------------------------ footer */
.site-footer { border-top: 1px solid var(--border); margin-top: 72px; padding: 40px 0 28px; font-size: 14px; background: var(--bg); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.footer-grid nav { display: flex; flex-direction: column; gap: 6px; }
.footer-grid nav a { color: var(--text); text-decoration: none; }
.footer-grid nav a:hover { color: var(--accent-ink); text-decoration: underline; }
.footer-h { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.footer-about p { margin: 12px 0 0; }
.brand-small .brand-name { font-size: 15px; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; }

/* ------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 8px 16px;
  font: 500 15px/1.2 var(--sans); color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { border-color: var(--text); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn-primary:hover { background: #3A3936; border-color: #3A3936; }
.btn-danger { color: var(--danger); border-color: #E3B7B3; }
.btn-danger:hover { border-color: var(--danger); }
.btn-danger-solid { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger-solid:hover { background: #95201A; }
.btn-lg { min-height: 46px; padding: 10px 20px; font-size: 16px; }
.btn-sm { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-link { background: none; border: 0; padding: 4px 0; color: var(--accent-ink); font: inherit; font-size: 14px; cursor: pointer; text-decoration: underline; text-decoration-color: rgba(169, 80, 47, .35); text-underline-offset: 2px; }
.btn-link:disabled { color: var(--muted); cursor: default; text-decoration: none; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.actions-tight { margin-top: 16px; align-items: center; }
.link-arrow::after { content: " →"; }

/* ------------------------------------------------------------ cards, notices, badges */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px; margin-bottom: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head .h3 { margin-bottom: 0; }
.subcard { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; background: var(--bg); }
.subcard .h4 { margin-top: 0; }
.notice { background: var(--warn-soft); border: 1px solid #EFE0BD; border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; font-size: 15px; }
.notice-warn { background: var(--warn-soft); }
.notice-error { background: var(--danger-soft); border-color: #F0C8C4; color: #7A1C16; }
.notice-inline { font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.empty { color: var(--muted); font-size: 14px; padding: 12px 0 4px; margin: 0; }
.warn-text { color: #7A4A12; }
.badge { display: inline-block; font-size: 12px; line-height: 1.5; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg); color: var(--muted); white-space: nowrap; font-weight: 500; }
.badge-ok { background: var(--ok-soft); border-color: #CFE3D4; color: var(--ok); }
.badge-failed { background: var(--danger-soft); border-color: #F0C8C4; color: var(--danger); }
.badge-pending { background: var(--warn-soft); border-color: #EFE0BD; color: #7A4A12; }
.badge-req { background: var(--accent-soft); border-color: #EFD3C6; color: var(--accent-ink); }
.chip { display: inline-block; font-size: 12px; padding: 1px 6px; margin: 2px 4px 2px 0; border-radius: 4px; background: var(--code-bg); }
.chip-req { color: var(--accent-ink); }

/* ------------------------------------------------------------ code blocks */
.codeblock { border: 1px solid var(--border); border-radius: var(--radius); background: var(--code-bg); overflow: hidden; margin: 0 0 20px; }
.codeblock-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; padding: 0 8px 0 14px; border-bottom: 1px solid var(--border); background: #ECE9E0; }
.codeblock-label { font-size: 12px; color: var(--muted); font-weight: 500; letter-spacing: .02em; }
.codeblock-meta { font: 12px var(--mono); color: var(--ok); margin-right: 6px; }
.codeblock pre { padding: 14px 16px; max-height: 560px; }
.codeblock pre:focus-visible { outline-offset: -2px; }
.copy-btn { font: 500 12px var(--sans); color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: var(--radius-sm); padding: 4px 8px; cursor: pointer; }
.copy-btn:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface); }
.copy-btn.is-copied { color: var(--ok); }
.copy-inline { border-color: var(--border); background: var(--surface); margin-left: 4px; }
.tablist { display: flex; gap: 2px; align-self: stretch; }
.tablist [role="tab"] { font: 500 13px var(--sans); color: var(--muted); background: none; border: 0; border-bottom: 2px solid transparent; padding: 0 10px; cursor: pointer; margin-bottom: -1px; }
.tablist [role="tab"]:hover { color: var(--text); }
.tablist [role="tab"][aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.code-tabs .codeblock-head { padding-left: 4px; }

/* ------------------------------------------------------------ home */
.hero { padding: 72px 0 56px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.hero .lede { font-size: 19px; }
.facts { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--muted); font-size: 14px; }
.facts li { position: relative; padding-left: 14px; }
.facts li::before { content: ""; position: absolute; left: 0; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.hero-code .codeblock pre { max-height: 360px; }
.hero-code .codeblock-response pre { max-height: 300px; }

.section { padding: 64px 0; }
.section-tight { padding: 40px 0 56px; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { margin-bottom: 24px; }
.section-head .h2 { margin-bottom: 6px; }

.pgroup { margin-top: 28px; }
.pgroup-h { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .02em; margin: 0 0 10px; }
.pgrid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(208px, 1fr)); gap: 10px; }
.pgrid-compact { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); margin-bottom: 20px; }
.ptile { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: var(--text); height: 100%; transition: border-color .15s ease; }
.ptile:hover { border-color: var(--border-strong); }
.ptile:hover .ptile-name { color: var(--accent-ink); }
.ptile-text { display: flex; flex-direction: column; min-width: 0; }
.ptile-name { font-weight: 500; font-size: 15px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ptile-count { font-size: 12px; color: var(--muted); }
.plogo { display: inline-block; flex: none; border-radius: 6px; object-fit: contain; vertical-align: middle; }
.plogo-letter { display: inline-flex; align-items: center; justify-content: center; background: var(--tile); color: var(--tile-fg); font: 600 13px/1 var(--sans); border-radius: 6px; }

.steps { list-style: none; padding: 0; margin: 8px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.steps li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 22px 8px; }
.steps h3 { font-size: 17px; margin: 10px 0 8px; }
.steps p { color: var(--muted); font-size: 15px; }
.step-n { font-family: var(--serif); font-size: 28px; color: var(--accent); line-height: 1; }

.pricing-teaser { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: end; }
.price-big { font-family: var(--serif); font-size: clamp(30px, 3.6vw, 42px); margin: 0; line-height: 1.1; }
.pricing-teaser p { color: var(--muted); }
.pricing-teaser .link-arrow { font-weight: 500; }

.faq details { border-bottom: 1px solid var(--border); }
.faq details:first-child { border-top: 1px solid var(--border); }
.faq summary { cursor: pointer; list-style: none; padding: 16px 32px 16px 0; font-weight: 500; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 13px; font-size: 20px; color: var(--muted); font-weight: 400; }
.faq details[open] summary::after { content: "−"; }
.faq details p { color: var(--muted); margin: 0 0 18px; max-width: 680px; }

/* ------------------------------------------------------------ pricing */
.page-head { padding: 56px 0 8px; }
.packs { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.pack { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.pack-pay { display: flex; flex-direction: column; margin-bottom: 4px; }
.pack-label { font-size: 13px; color: var(--muted); }
.pack-amount { font-family: var(--serif); font-size: 32px; line-height: 1.15; }
.pack-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 8px; font-size: 14px; border-top: 1px solid var(--border); padding-top: 8px; }
.pack-row > * { white-space: nowrap; }
.pack-row span:first-child { color: var(--muted); }
.pack .btn { margin-top: 8px; }
.pack-cta { margin: 20px 0 0; }
.notes { margin-top: 36px; max-width: 760px; }
.checklist { list-style: none; padding: 0; }
.checklist li { position: relative; padding-left: 22px; margin-bottom: 8px; color: var(--text); }
.checklist li::before { content: ""; position: absolute; left: 2px; top: .55em; width: 9px; height: 5px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }

.table-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.table-toolbar .h2 { margin-bottom: 0; }
.search input { width: 320px; max-width: 100%; }
.price-group { margin-bottom: 24px; }
.price-group-h { display: flex; align-items: baseline; gap: 10px; font-size: 16px; margin: 0 0 8px; }
.price-group-h a { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; }
.price-group-h a:hover span { color: var(--accent-ink); }
.price-table td:first-child { width: 100%; }
.ep-id { font-size: 12px; color: var(--muted); background: none; padding: 0 0 0 6px; }

/* ------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 4px; }
.card .table-wrap { margin-left: -4px; margin-right: -4px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--surface); }
.section-alt .table { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 13px; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table th.num, .table td.num { text-align: right; }
.table .sub { display: block; font-size: 12px; color: var(--muted); font-family: var(--mono); margin-top: 2px; overflow-wrap: anywhere; }
.table tr.is-clickable { cursor: pointer; }
.table tr.is-clickable:hover td { background: var(--bg); }
.params-table td:nth-child(-n+3) code, .params-table td:nth-child(-n+3) { white-space: nowrap; }
.params-table td:nth-child(4) { min-width: 200px; }
.params-table td:nth-child(5) { min-width: 96px; }
.params-table td:nth-child(5) code { word-break: break-all; }
.table td .badge + .sub { white-space: nowrap; }
.table td.note-cell { min-width: 180px; }
.table tbody th { text-align: left; font-weight: 500; color: var(--text); font-size: 14px; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table tbody tr:last-child th { border-bottom: 0; }
.docs-main .table { border: 1px solid var(--border); border-radius: var(--radius); border-collapse: separate; border-spacing: 0; }
.docs-main .table th:first-child, .docs-main .table td:first-child { padding-left: 14px; }
.nowrap { white-space: nowrap; }

/* ------------------------------------------------------------ forms */
.form .field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 14px; font-weight: 500; }
.field .hint { font-size: 12px; color: var(--muted); }
input[type="text"], input[type="email"], input[type="number"], input[type="search"], select, textarea {
  font: 15px/1.4 var(--sans); color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: 9px 12px; min-height: 40px; width: 100%;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(201, 100, 66, .16); }
input[readonly] { background: var(--bg); color: var(--muted); }
select { appearance: none; -webkit-appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236B6A63' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 16px; align-items: start; }
.field-submit { justify-content: flex-end; }
.field-submit::before { content: "\00a0"; font-size: 14px; }
.form-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.form-error { color: var(--danger); font-size: 14px; margin: 0 0 12px; }
.form-status { min-height: 1em; }
.req { color: var(--accent-ink); }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 12px; }
.filters .field { margin-bottom: 0; display: flex; flex-direction: column; gap: 6px; min-width: 160px; }
.filters .field-grow { flex: 1 1 240px; }
.filters .field-submit::before { content: none; }
.search-inline { display: flex; gap: 8px; }
.search-inline input { width: 260px; max-width: 100%; }

/* ------------------------------------------------------------ docs */
.docs { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 48px; padding-top: 40px; }
.docs-nav { position: sticky; top: calc(var(--header-h) + 24px); align-self: start; max-height: calc(100vh - var(--header-h) - 48px); overflow-y: auto; font-size: 14px; padding-bottom: 24px; scrollbar-width: thin; }
.docs-nav-toggle { display: none; }
.docs-nav-h { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .03em; margin: 20px 0 6px; }
.docs-nav-h:first-child { margin-top: 0; }
.docs-nav-list { list-style: none; padding: 0; margin: 0; }
.docs-nav-list a { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; line-height: 1.35; }
.docs-nav-list a:hover { background: var(--bg-alt); }
.docs-nav-list a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); font-weight: 500; }
.docs-nav-list .count { margin-left: auto; color: var(--muted); font-size: 12px; }
.docs-nav-list .plogo { border-radius: 4px; }
.docs-nav-sub { list-style: none; padding: 2px 0 6px 16px; margin: 0 0 0 8px; border-left: 1px solid var(--border); }
.docs-nav-sub a { font-size: 13px; padding: 4px 8px; }
.docs-main { min-width: 0; max-width: 860px; padding-bottom: 24px; }
.prose h2 { font-family: var(--serif); font-weight: 400; font-size: 26px; margin: 48px 0 14px; padding-top: 8px; }
.prose h3 { margin: 24px 0 10px; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: 6px; }
.toc { margin: 28px 0 8px; padding: 16px 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.toc ol { margin: 0; columns: 2; column-gap: 32px; font-size: 14px; }
.toc li { margin: 3px 0; break-inside: avoid; }
.link-list { list-style: none; padding: 0; }
.link-list li { padding: 6px 0; border-bottom: 1px solid var(--border); }
.breadcrumb { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent-ink); text-decoration: underline; }
.platform-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 28px; }
.platform-head .plogo { margin-top: 4px; }
.platform-head .display-sm { margin-bottom: 6px; }
.alt-name { font-size: .6em; color: var(--muted); font-family: var(--sans); }
.ep-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--border); }
.ep-item { padding: 18px 0; border-bottom: 1px solid var(--border); }
.ep-item-top { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.ep-title { font-size: 17px; font-weight: 600; }
.ep-title a { color: var(--text); text-decoration: none; }
.ep-title a:hover { color: var(--accent-ink); text-decoration: underline; }
.price-tag { font: 500 14px var(--mono); white-space: nowrap; }
.ep-path { margin: 6px 0; font-size: 14px; }
.ep-path code { background: none; padding: 0; }
.ep-desc { color: var(--muted); font-size: 15px; margin: 4px 0; }
.ep-params { margin: 6px 0 0; }
.method { font: 600 12px var(--mono); color: var(--accent-ink); background: var(--accent-soft); border-radius: 4px; padding: 2px 6px; letter-spacing: .03em; }
.ep-meta { margin: 24px 0 32px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.ep-meta-row { display: flex; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--border); align-items: baseline; flex-wrap: wrap; }
.ep-meta-row:last-child { border-bottom: 0; }
.ep-meta-row dt { width: 110px; flex: none; color: var(--muted); font-size: 14px; }
.ep-meta-row dd { margin: 0; min-width: 0; }
.ep-meta-path dd { font-size: 15px; }
.ep-meta-path code { background: none; padding: 0; font-size: 14px; }
.docs-main > .h3 { margin-top: 36px; }
.try { margin: 36px 0 12px; padding: 22px 24px; }
.try .h3 { margin-bottom: 14px; }
.try-result { margin-top: 20px; }
.try-meta { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 14px; margin-bottom: 10px; }
.try-meta b { font-weight: 500; color: var(--muted); margin-right: 6px; }
.try-result pre { background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; max-height: 520px; }

/* ------------------------------------------------------------ auth */
.auth { display: flex; justify-content: center; padding: 64px 20px 24px; }
.auth-card { width: 100%; max-width: 440px; padding: 32px; }
.auth-card .display-sm { font-size: 28px; }
.auth-card form { margin-top: 24px; }
.code-input { font: 500 24px var(--mono) !important; letter-spacing: .4em; text-align: center; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; }
.trial-note { margin: 20px 0 8px; padding: 10px 14px; background: var(--accent-soft); border-radius: var(--radius); font-size: 14px; color: #6E3420; }

/* ------------------------------------------------------------ legal */
.legal { padding-top: 48px; }
.legal-body h2 { font-family: var(--serif); font-weight: 400; font-size: 22px; margin: 36px 0 10px; }
.legal-body h3 { font-size: 16px; margin: 20px 0 8px; }
.legal-body p, .legal-body li { color: #33322F; }
.legal-body li { margin-bottom: 6px; }
.legal-meta { color: var(--muted); font-size: 14px; }
.legal-operator { margin: 24px 0; padding: 16px 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); font-size: 14px; }
.legal-operator p { margin: 0; }
.legal-nav { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; margin: 16px 0 0; }
.legal-nav a[aria-current="page"] { color: var(--text); text-decoration: none; font-weight: 500; }

/* ------------------------------------------------------------ console */
.console { display: grid; grid-template-columns: 208px minmax(0, 1fr); gap: 40px; padding-top: 32px; }
.console-side { position: sticky; top: calc(var(--header-h) + 24px); align-self: start; }
.console-account { display: flex; flex-direction: column; gap: 4px; padding: 0 10px 16px; margin-bottom: 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
.console-email { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.console-balance strong { font-weight: 600; font-variant-numeric: tabular-nums; }
.console-tabs { display: flex; flex-direction: column; gap: 2px; }
.console-tabs a { padding: 8px 10px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; font-size: 15px; }
.console-tabs a:hover { background: var(--bg-alt); }
.console-tabs a[aria-current="page"] { background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); font-weight: 500; }
.console-main { min-width: 0; }
.console-main > section > .h2 { margin-bottom: 18px; }
.console-main > section > .muted { margin-top: -8px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.panel-head .h2 { margin-bottom: 0; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stats-one { grid-template-columns: minmax(200px, 320px); }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat-label { font-size: 13px; color: var(--muted); }
.stat-value { font-family: var(--serif); font-size: 28px; line-height: 1.25; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat a { margin-top: 2px; }

.segmented { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); padding: 2px; }
.segmented button { font: 500 13px var(--sans); color: var(--muted); background: none; border: 0; border-radius: 6px; padding: 6px 10px; cursor: pointer; white-space: nowrap; }
.segmented button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.segmented-sm button { padding: 4px 8px; font-size: 12px; }

.chart { width: 100%; min-height: 180px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .bar-ok { fill: var(--accent); }
.chart .bar-failed { fill: #D9D6CA; }
.chart .bar-spend { fill: var(--accent); }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .axis-label { fill: var(--muted); font: 11px var(--sans); }
.chart .col:hover rect { opacity: .8; }
.chart .hit { fill: transparent; }
.chart-legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.sw-ok { background: var(--accent); }
.sw-failed { background: #D9D6CA; }

.key-reveal { border-color: #EFD3C6; background: #FFFCFA; }
.key-reveal:focus { outline: none; }
.key-box { display: flex; align-items: center; gap: 8px; background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; margin: 8px 0 16px; }
.key-box code { background: none; padding: 0; font-size: 14px; flex: 1; overflow-wrap: anywhere; user-select: all; }
.keys-table td { vertical-align: middle; }
.keys-table input { min-height: 34px; padding: 6px 10px; font-size: 14px; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.row-confirm td { background: var(--danger-soft); }
.row-confirm .row-actions { justify-content: flex-start; align-items: center; }

.packs-console { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); margin-bottom: 16px; }
.packs-console .pack { background: var(--bg); }

.return-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 28px; }
.return-card .h3 { font-family: var(--serif); font-weight: 400; font-size: 24px; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--accent); animation: spin 0.9s linear infinite; margin-bottom: 8px; }
.return-card[data-state="paid"] .spinner, .return-card[data-state="pending"] .spinner, .return-card[data-state="expired"] .spinner, .return-card[data-state="missing"] .spinner { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.kv { margin: 0 0 12px; display: grid; gap: 0; }
.kv > div { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.kv > div:last-child { border-bottom: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.kv-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); column-gap: 24px; }
.kv-grid > div:last-child { border-bottom: 1px solid var(--border); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin: 16px 0 8px; }
.load-more { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 12px; }

/* ------------------------------------------------------------ 404 */
.notfound { padding: 96px 0 40px; text-align: left; }
.notfound .display { margin-bottom: 12px; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1020px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .packs { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .footer-about { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  .docs { grid-template-columns: minmax(0, 1fr); gap: 16px; padding-top: 20px; }
  .docs-nav { position: static; max-height: none; overflow: visible; padding-bottom: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
  .docs-nav-toggle { display: flex; width: 100%; align-items: center; justify-content: space-between; font: 500 15px var(--sans); color: var(--text); background: none; border: 0; padding: 12px 16px; cursor: pointer; }
  .docs-nav-toggle::after { content: "+"; color: var(--muted); font-size: 18px; }
  .docs-nav-toggle[aria-expanded="true"]::after { content: "−"; }
  .docs-nav-body { padding: 0 12px 12px; }
  .js .docs-nav-body:not(.is-open) { display: none; }
  .console { grid-template-columns: minmax(0, 1fr); gap: 16px; padding-top: 16px; }
  .console-side { position: static; }
  .console-account { flex-direction: row; justify-content: space-between; padding: 0 2px 12px; margin-bottom: 8px; }
  .console-tabs { flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 4px; scrollbar-width: none; }
  .console-tabs::-webkit-scrollbar { display: none; }
  .console-tabs a { white-space: nowrap; font-size: 14px; padding: 7px 12px; border: 1px solid var(--border); background: var(--surface); }
  .console-tabs a[aria-current="page"] { background: var(--text); color: var(--bg); box-shadow: none; border-color: var(--text); }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .pricing-teaser { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .toc ol { columns: 1; }
}

@media (max-width: 600px) {
  :root { --header-h: 56px; }
  body { font-size: 15px; }
  .wrap { padding-left: 16px; padding-right: 16px; }
  .brand-sub { display: none; }
  .site-nav { gap: 0; }
  .site-nav a { padding: 6px 8px; font-size: 14px; }
  .hero { padding: 40px 0 32px; }
  .hero .lede, .lede { font-size: 16px; }
  .section { padding: 44px 0; }
  .page-head { padding: 36px 0 0; }
  .packs { grid-template-columns: 1fr 1fr; gap: 10px; }
  .pack { padding: 14px; }
  .pack-amount { font-size: 26px; }
  .pgrid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .ptile { padding: 10px; gap: 10px; }
  .ptile-name { font-size: 14px; }
  .card { padding: 16px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .footer-bottom { flex-direction: column; }
  .auth { padding-top: 28px; }
  .auth-card { padding: 22px 18px; }
  .search input, .search-inline input { width: 100%; }
  .search, .search-inline { width: 100%; }
  .ep-meta-row dt { width: auto; }
  .stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat { padding: 12px; }
  .stat-value { font-size: 22px; }
  .codeblock pre { font-size: 12px; padding: 12px; }
  .table th, .table td { padding: 8px 8px; }
  .panel-head { align-items: flex-start; }
  /* parameters: one card per row */
  .docs-main .params-table, .params-table tbody, .params-table tr, .params-table td { display: block; }
  .params-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .params-table tr { padding: 12px 14px; border-bottom: 1px solid var(--border); }
  .params-table tbody tr:last-child { border-bottom: 0; }
  .params-table td, .docs-main .params-table td:first-child { border: 0; padding: 0; min-width: 0 !important; }
  .params-table td:nth-child(-n+3) { display: inline-block; margin-right: 8px; vertical-align: middle; }
  .params-table td.param-desc { margin-top: 6px; }
  .params-table td.is-empty { display: none; }
  .params-table td[data-label] { margin-top: 6px; }
  .params-table td[data-label]::before { content: attr(data-label); display: inline-block; min-width: 56px; margin-right: 6px; color: var(--muted); font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

@media print {
  .site-header, .site-footer, .docs-nav, .console-side, .try { display: none; }
  body { background: #fff; }
}
