:root {
    color-scheme: light;
    --posapi-ink: #172b43;
    --posapi-muted: #526276;
    --posapi-navy: #10243a;
    --posapi-accent: #1463ad;
    --posapi-surface: #f6f8fb;
    --posapi-border: #dce3ec;
    --posapi-warning: #725016;
    --posapi-warning-bg: #fffbf2;
    --posapi-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft JhengHei", "PingFang TC", sans-serif;
    --scalar-font: var(--posapi-font);
    --scalar-font-code: "Cascadia Code", Consolas, monospace;
}
body { margin: 0; font-family: var(--posapi-font); color: var(--posapi-ink); background: #fff; }
body.light-mode {
    --scalar-color-1: var(--posapi-ink);
    --scalar-color-2: var(--posapi-muted);
    --scalar-color-3: #607086;
    --scalar-color-accent: var(--posapi-accent);
    --scalar-background-1: #fff;
    --scalar-background-2: var(--posapi-surface);
    --scalar-background-3: #eaf0f7;
    --scalar-background-accent: #e8f1fc;
    --scalar-border-color: var(--posapi-border);
    --scalar-color-green: #18754b;
    --scalar-sidebar-width: 300px;
    --scalar-sidebar-background-1: var(--posapi-surface);
    --scalar-sidebar-color-1: var(--posapi-ink);
    --scalar-sidebar-color-2: var(--posapi-muted);
    --scalar-sidebar-color-active: #114d88;
    --scalar-sidebar-border-color: var(--posapi-border);
    --scalar-sidebar-item-hover-background: #eaf0f7;
    --scalar-sidebar-item-hover-color: var(--posapi-ink);
    --scalar-sidebar-item-active-background: #e4edf9;
    --scalar-sidebar-search-background: #fff;
    --scalar-sidebar-search-border-color: var(--posapi-border);
    --scalar-sidebar-search-color: var(--posapi-muted);
}
.posapi-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 24px; padding: 20px 32px; background: var(--posapi-navy); color: #fff; border-bottom: 3px solid #3d84c9; }
.posapi-brand { display: flex; align-items: center; gap: 14px; }
.posapi-brand-mark { display: grid; place-items: center; width: 42px; height: 46px; background: #203c59; border: 1px solid #5d7d9e; border-radius: 10px 10px 10px 2px; font-size: 24px; font-weight: 650; }
.posapi-brand strong { font-size: 20px; font-weight: 650; letter-spacing: .05em; }
.posapi-brand-caption { display: block; margin-top: 4px; color: #d7e3f0; font-size: 13px; line-height: 1.5; }
.posapi-brand-caption [lang="en"] { display: block; color: #b9cbe0; font-size: 12px; letter-spacing: .02em; }
.posapi-header nav { display: flex; flex-wrap: wrap; gap: 10px; }
.posapi-doc-link { display: flex; flex-direction: column; justify-content: center; gap: 4px; box-sizing: border-box; min-height: 52px; padding: 10px 18px; border: 1px solid #59728b; border-radius: 7px; color: #fff; text-decoration: none; font-size: 14px; line-height: 1.25; transition: background-color .15s, border-color .15s; }
.posapi-doc-link [lang="en"] { color: #cedceb; font-size: 12px; }
.posapi-doc-link-primary { background: #233e5b; }
.posapi-doc-link:hover { background: #2b4b6e; border-color: #9ebbd7; }
.posapi-doc-link:focus-visible, .posapi-skip:focus-visible { outline: 3px solid #a9d6ff; outline-offset: 4px; }
.posapi-skip { position: absolute; top: 8px; left: 12px; z-index: 100; padding: 12px 20px; background: #fff; color: var(--posapi-ink); border: 2px solid var(--posapi-accent); border-radius: 6px; transform: translateY(-150%); }
.posapi-skip [lang="en"] { display: block; margin-top: 4px; }
.posapi-skip:focus { transform: translateY(0); }
.posapi-notice { display: flex; gap: 12px; padding: 16px 32px; background: var(--posapi-warning-bg); color: var(--posapi-warning); border-bottom: 1px solid #e9dec5; }
.posapi-notice-icon { flex: 0 0 20px; margin-top: 2px; }
.posapi-notice > div { min-width: 0; }
.posapi-notice strong { display: block; margin-bottom: 10px; font-size: 14px; font-weight: 650; line-height: 1.5; }
.posapi-notice strong [lang="en"] { display: block; font-size: 12px; font-weight: 500; color: #796339; }
.posapi-bilingual { margin: 12px 0 20px; }
#scalar-app .posapi-bilingual p, .posapi-notice .posapi-bilingual p { margin: 0; color: var(--posapi-ink); font-size: 15px; line-height: 1.8; overflow-wrap: anywhere; }
#scalar-app .posapi-bilingual p[lang="en"], .posapi-notice .posapi-bilingual p[lang="en"] { margin-top: 10px; color: var(--posapi-muted); font-size: 14px; line-height: 1.7; }
/* Scalar 1.67 applies !important to every descendant in schema descriptions.
   Override only our language paragraphs, leaving native controls unchanged. */
#scalar-app .posapi-bilingual p[lang="zh-Hant"] { color: var(--posapi-ink) !important; }
#scalar-app .posapi-bilingual p[lang="en"] { color: var(--posapi-muted) !important; }
.posapi-notice .posapi-bilingual { margin: 0; }
.posapi-notice .posapi-bilingual p { color: var(--posapi-warning); font-size: 13px; line-height: 1.65; }
.posapi-notice .posapi-bilingual p[lang="en"] { color: #6d5d3d; font-size: 12px; margin-top: 5px; }
#scalar-app .posapi-heading-translation { display: block; margin-top: 6px; color: var(--posapi-muted); font-size: 14px; line-height: 1.5; font-weight: 500; letter-spacing: .01em; }
#scalar-app .section-header-label { white-space: pre-line; line-height: 1.5; letter-spacing: -.015em; }
#scalar-app [class~="group/button-label"] { white-space: pre-line; line-height: 1.5; }
#scalar-app .section-header-label:lang(en) { letter-spacing: 0; }
#scalar-app h1.section-header-label { font-size: clamp(24px, 2.2vw, 32px); font-weight: 650; }
#scalar-app h2 { scroll-margin-top: 24px; }
#scalar-app a:focus-visible, #scalar-app button:focus-visible { outline: 2px solid var(--posapi-accent); outline-offset: 3px; }
.posapi-status { margin: 24px 32px; padding: 20px 24px; border: 1px solid var(--posapi-border); border-radius: 8px; color: var(--posapi-ink); background: var(--posapi-surface); line-height: 1.7; }
.posapi-status > span { display: block; }
.posapi-status p { margin: 0; }
.posapi-status [lang="en"] { display: block; margin-top: 6px; color: var(--posapi-muted); }
.posapi-status[role="alert"] { border-color: #d8a5a5; background: #fff7f7; color: #9a2626; }
.posapi-status[hidden] { display: none; }
@media (max-width: 640px) {
    .posapi-header { gap: 16px; padding: 20px; }
    .posapi-header nav { width: 100%; }
    .posapi-doc-link { flex: 1; }
    .posapi-notice { padding: 16px 20px; }
    .posapi-status { margin: 20px; }
    #scalar-app .posapi-bilingual p { font-size: 16px; }
    #scalar-app .posapi-bilingual p[lang="en"] { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
    .posapi-doc-link { transition: none; }
}
