/**
 * npipublicdata.org - NPI brand overrides
 * Uses blue primary instead of gold
 */
:root {
    --primary: #1a73e8;
    --primary-dark: #1557b0;
    --primary-light: #4285f4;
    --primary-rgb: 26, 115, 232;
    /* Neutral slate “second” brand tone (replaces clinical green) */
    --secondary: #475569;
    --secondary-dark: #334155;
    --secondary-light: #64748b;
    --secondary-rgb: 71, 85, 105;
    --accent: #ea4335;
    --link-color: #1a73e8;
    --link-color-hover: #1557b0;
    --theme-color: #1a73e8;
    /* Docs / Knowledge Base / API UI accent (blue; not teal) */
    --npi-doc-accent: #2563eb;
    --npi-doc-accent-hover: #1d4ed8;
    --npi-doc-accent-ink: #1e40af;
    --npi-doc-accent-ink-deep: #1e3a8a;
    --npi-doc-accent-soft: #eff6ff;
    --npi-doc-accent-soft-2: #dbeafe;
    --npi-doc-accent-border: #93c5fd;
    --npi-doc-accent-border-light: #bfdbfe;
    --npi-doc-accent-bar: #3b82f6;
    --npi-doc-on-dark: #93c5fd;
    /* Shared hero (home, tool pages, inner heroes): dark navy → teal-blue */
    --npi-hero-gradient: linear-gradient(148deg, #071a2e 0%, #0c3d5c 38%, #075985 100%);
}

/* Brand text logo - header and footer */
.navbar-brand .brand-text {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-dark);
}
.navbar-brand .brand-text .blue {
    color: #1a73e8;
}
.footer-brand .brand-text span {
    color: var(--primary);
}

/* Hero gradient: one bar across home, lookup, KB, API, legal intros, etc. */
.hero, .hero-home, .hero-tool {
    background: var(--npi-hero-gradient) !important;
}

/* Hero-home overlay (subtle cyan / indigo glow on dark navy base) */
.hero-home::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 90% 70% at 100% -10%, rgba(56, 189, 248, 0.18) 0%, transparent 55%),
        radial-gradient(ellipse 55% 45% at 0% 100%, rgba(129, 140, 248, 0.12) 0%, transparent 52%),
        radial-gradient(ellipse at 50% 50%, rgba(7, 89, 133, 0.12) 0%, transparent 58%);
    pointer-events: none;
}

/* Hero CTA button - NPI brand */
.hero-cta-btn {
    background: #fff !important;
    color: #071a2e !important;
}
.hero-cta-btn:hover {
    color: #071a2e !important;
}

.site-header {
    background: #fff;
}

.footer-accent {
    background: linear-gradient(90deg, #1a73e8, #2563eb);
}

/* NPPES notice: plain text, tab-label-style weight (lookup + result pages) */
.nppes-please-note-plain {
    margin-top: 1.25rem;
    font-size: 0.875rem;
    line-height: 1.55;
    color: #334155;
    font-weight: 600;
}
.nppes-please-note-plain a {
    font-weight: 600;
    color: #1a4480;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.nppes-please-note-plain a:hover {
    color: #005ea2;
}

/* Two-paragraph footer disclaimer (spacing; base styles in main.css) */
.footer-disclaimer p + p {
    margin-top: 0.75rem;
}
.footer-disclaimer .footer-disclaimer-lead {
    margin-bottom: 0;
}

/* Footer social links */
.social-link--facebook { color: #1877F2; }
.social-link--facebook:hover { color: #42a1f5; background: rgba(24,119,242,0.15); }
.social-link--x { color: #e7e9ea; }
.social-link--x:hover { color: #fff; background: rgba(231,233,234,0.15); }
.social-link--instagram { color: #E4405F; }
.social-link--instagram:hover { color: #f77737; background: rgba(228,64,95,0.15); }
.social-link--reddit { color: #FF4500; }
.social-link--reddit:hover { color: #ff6b2b; background: rgba(255,69,0,0.15); }
.social-link--linkedin { color: #0a66c2; }
.social-link--linkedin:hover { color: #378fe9; background: rgba(10,102,194,0.15); }
.social-link--pinterest { color: #e60023; }
.social-link--pinterest:hover { color: #ff1744; background: rgba(230,0,35,0.15); }

.site-footer {
    background: var(--bg-dark);
}

/* Legacy “teal” utility name: render as doc accent blue */
.icon-teal {
    color: var(--npi-doc-accent) !important;
}
.sidebar-icon.icon-teal {
    background: var(--npi-doc-accent) !important;
}

/* Homepage icon strip: matches homepage.css (loads after this file on home) */
.hp-icon-box--green {
    background: linear-gradient(135deg, #1a73e8, #4285f4) !important;
}

/* Secondary buttons: shadow follows slate secondary, not legacy green RGB */
.btn-secondary:hover {
    box-shadow: 0 4px 12px rgba(var(--secondary-rgb), 0.35) !important;
}
.btn-secondary:active {
    box-shadow: 0 2px 8px rgba(var(--secondary-rgb), 0.28) !important;
}

/* main.css legacy “success green” accents → primary blue (less clinical wash) */
.commitment-icon {
    background: linear-gradient(145deg, rgba(var(--primary-rgb), 0.14) 0%, rgba(var(--primary-rgb), 0.07) 100%) !important;
    color: var(--primary) !important;
}
.recaptcha-notice-icon {
    background: linear-gradient(145deg, rgba(var(--primary-rgb), 0.14) 0%, rgba(var(--primary-rgb), 0.07) 100%) !important;
    color: var(--primary) !important;
}
.form-control.is-valid,
.form-select.is-valid {
    border-color: var(--primary) !important;
}
.contact-info-list li svg {
    color: var(--primary) !important;
}
/* Misnamed in base CSS: was bright green; use brand blue for sidebar dots */
.icon-warning {
    color: var(--primary) !important;
}
.sidebar-icon.icon-warning {
    background: var(--primary) !important;
}

/* Contact form: flat brand blue submit, no hover / shadow shift (matches site primary) */
.contact-form-card .contact-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.85rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #fff !important;
    background: var(--primary) !important;
    border: none !important;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    box-shadow: none !important;
    transition: none !important;
}
.contact-form-card .contact-submit-btn:hover,
.contact-form-card .contact-submit-btn:focus,
.contact-form-card .contact-submit-btn:focus-visible,
.contact-form-card .contact-submit-btn:active {
    background: var(--primary) !important;
    color: #fff !important;
    transform: none !important;
    box-shadow: none !important;
}
.contact-form-card .contact-submit-btn:focus-visible {
    outline: 2px solid rgba(var(--primary-rgb), 0.45);
    outline-offset: 2px;
}
.contact-form-card .contact-submit-btn:disabled {
    opacity: 0.85;
    cursor: wait;
}
.contact-form-card .contact-submit-btn svg {
    flex-shrink: 0;
}

.contact-form-card .contact-consent-group {
    display: flex;
    justify-content: center;
    width: 100%;
}
.contact-form-card .contact-consent-group .form-check.contact-consent-check {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding-left: 0;
    margin-bottom: 0;
    max-width: 100%;
    text-align: left;
}
.contact-form-card .contact-consent-group .form-check-input {
    width: 1.1em;
    height: 1.1em;
    margin-top: 0.2em;
    margin-left: 0;
    flex-shrink: 0;
    float: none;
    border-width: 2px;
    cursor: pointer;
}
.contact-form-card .contact-consent-group .form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}
.contact-form-card .contact-consent-group .form-check-label {
    cursor: pointer;
    line-height: 1.5;
    font-size: 0.95rem;
    color: var(--text-dark, #212529);
}
.contact-form-card .contact-consent-group .form-check-label a {
    color: var(--link-color);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Contact tips / sidebar (main.css used success green) */
.contact-tip-green {
    background: rgba(var(--primary-rgb), 0.06) !important;
    border-left-color: var(--primary) !important;
}
.contact-sidebar-icon-tips,
.contact-sidebar-icon-email {
    background: linear-gradient(145deg, rgba(var(--primary-rgb), 0.2) 0%, rgba(var(--primary-rgb), 0.1) 100%) !important;
    color: var(--primary-dark) !important;
}

/* Quiz card top stripe + progress bar — no clinical green segment */
.test-card::before {
    background: linear-gradient(90deg, #DC3545 0%, #F1C40F 33%, #1a73e8 66%, #2980B9 100%) !important;
}
.test-progress-fill {
    background: linear-gradient(90deg, #8E44AD 0%, #1a73e8 50%, #2980B9 100%) !important;
}

/* Quiz / test UI: selected state — brand blue */
.test-option-btn.selected {
    border-color: var(--primary) !important;
    background: rgba(var(--primary-rgb), 0.06) !important;
    box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.12) !important;
}
.test-option-btn.selected .test-option-letter {
    background: var(--primary) !important;
    color: #fff !important;
    border-color: var(--primary) !important;
}

/* NPI result modal header (match site hero gradient) */
.result-modal-header {
    background: var(--npi-hero-gradient) !important;
}

/* Search buttons use btn-success in markup — render as brand primary */
.btn-success {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--primary);
    --bs-btn-border-color: var(--primary);
    --bs-btn-hover-bg: var(--primary-dark);
    --bs-btn-hover-border-color: var(--primary-dark);
    --bs-btn-focus-shadow-rgb: var(--primary-rgb);
    --bs-btn-active-bg: var(--primary-dark);
    --bs-btn-active-border-color: var(--primary-dark);
    --bs-btn-disabled-bg: var(--primary);
    --bs-btn-disabled-border-color: var(--primary);
}
/* NPI search success message (only site use of .text-success) */
.text-success {
    color: var(--primary) !important;
}

/* Section backgrounds (from legacy style) */
.section-white { background: #fff; padding: 60px 0; }
.section-grey { background: #f5f5f5; padding: 60px 0; }
.section-blue { background: #1a73e8; color: #fff; padding: 60px 0; }
.section-blue .medium-title.white { color: #fff; }
.visually-hidden-focusable { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.visually-hidden-focusable:focus { position: fixed; top: 0; left: 0; width: auto; height: auto; padding: 0.5rem 1rem; margin: 0; overflow: visible; clip: auto; white-space: normal; z-index: 9999; background: #fff; }

/* Dropdown items with menu-icon - align icon and text */
.navbar-nav .dropdown .dropdown-item {
    display: flex;
    align-items: center;
}

/* Bootstrap 5 compatibility - navbar-toggler */
.navbar-toggler {
    border: none;
    padding: 0.5rem;
}

/* NPI page components - sections, cards, panels, tables */
.npi-section { padding: 50px 0; }
.npi-section + .npi-section { border-top: 1px solid rgba(0,0,0,0.05); }
.npi-section.warm { background: var(--bg-warm); }
.npi-section h2 { font-size: clamp(1.6rem, 3vw, 2rem); font-weight: 700; color: var(--text-dark); margin-bottom: 0.35rem; }
.npi-intro { font-size: 1.05rem; line-height: 1.8; }
.npi-intro p { color: var(--text-muted); margin-bottom: 1.15rem; }
.npi-intro a { color: var(--link-color); text-decoration: underline; text-decoration-color: var(--link-color); text-underline-offset: 2px; }
.npi-intro a:hover { color: var(--link-color-hover); text-decoration-color: var(--link-color-hover); }
.npi-card-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
.npi-card {
    background: #fff; border-radius: var(--radius-md); padding: 1.5rem 1.75rem;
    border: 1px solid rgba(0,0,0,0.05); border-top: 3px solid transparent;
}
.npi-card.red { border-top-color: #E74C3C; }
.npi-card.orange { border-top-color: #E67E22; }
.npi-card.green { border-top-color: #2980B9; }
.npi-card.blue { border-top-color: #2980B9; }
.npi-card h3 { font-size: 0.95rem; font-weight: 700; color: var(--text-dark); margin-bottom: 0.4rem; }
.npi-card p { color: var(--text-muted); line-height: 1.7; margin: 0 0 1rem 0; font-size: 0.9rem; }
.npi-card p:last-child { margin-bottom: 0; }
.npi-card a { color: var(--link-color); text-decoration: underline; }
.npi-card a:hover { color: var(--link-color-hover); }
.npi-panel-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
.npi-panel { background: #fff; border-radius: var(--radius-md); padding: 1.5rem 1.75rem; border: 1px solid rgba(0,0,0,0.05); }
.npi-panel h3 { font-size: 1rem; font-weight: 700; color: var(--text-dark); margin-bottom: 0.4rem; }
.npi-panel p { color: var(--text-muted); line-height: 1.7; margin: 0; font-size: 0.9rem; }
.npi-panel a { color: var(--link-color); text-decoration: underline; }
.npi-panel-label { display: inline-block; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; background: var(--bg-cream); color: var(--primary-dark); padding: 0.2rem 0.6rem; border-radius: 20px; margin-bottom: 0.75rem; }
.npi-block-list { display: flex; flex-direction: column; gap: 1rem; }
.npi-block { background: #fff; border-radius: var(--radius-md); padding: 1.5rem 1.75rem; border: 1px solid rgba(0,0,0,0.05); border-left: 4px solid var(--primary); }
.npi-block--accent { border-left-color: #E67E22; }
.npi-block h3 { font-size: 1rem; font-weight: 700; color: var(--text-dark); margin-bottom: 0.4rem; }
.npi-block p { color: var(--text-muted); line-height: 1.7; margin: 0; font-size: 0.9rem; }
.npi-block a { color: var(--link-color); text-decoration: underline; }
.npi-block a:hover { color: var(--link-color-hover); }
.npi-table-wrap { overflow-x: auto; margin-top: 1.5rem; }
.npi-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-xs); }
.npi-table th { padding: 0.85rem 1.15rem; text-align: left; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-light); background: var(--bg-cream); }
.npi-table thead th {
    border-bottom: 2px solid rgba(0, 0, 0, 0.04);
}
.npi-table td { padding: 0.85rem 1.15rem; font-size: 0.9rem; color: var(--text-muted); border-bottom: 1px solid rgba(0,0,0,0.04); vertical-align: middle; }
.npi-table tr:last-child td { border-bottom: none; }
.npi-table .td-name { font-weight: 700; color: var(--text-dark); }
.section:not(.section-warm) .npi-card,
.section:not(.section-warm) .npi-panel,
.section:not(.section-warm) .npi-block { background: var(--bg-warm); }
.section:not(.section-warm) .npi-table { background: var(--bg-warm); }
.section:not(.section-warm) .npi-table th { background: var(--bg-cream); }
.npi-cta { text-align: center; padding: 50px 0; background: var(--npi-hero-gradient); }
.npi-cta h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; color: #fff; margin-bottom: 0.75rem; }
.npi-cta p { font-size: 1rem; color: rgba(255,255,255,0.75); max-width: 540px; margin: 0 auto 1.5rem; line-height: 1.6; }
.npi-cta .cta-btn { display: inline-flex; align-items: center; background: var(--primary); color: #fff; font-weight: 700; font-size: 1rem; padding: 0.85rem 2rem; border-radius: var(--radius-md); text-decoration: none; transition: all 0.2s; }
.npi-cta .cta-btn:hover { background: var(--primary-dark); transform: translateY(-2px); color: #fff; }
.npi-feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
.npi-feature { background: #fff; border-radius: var(--radius-md); padding: 1.5rem 1.75rem; border: 1px solid rgba(0,0,0,0.05); }
.section:not(.section-warm) .npi-feature { background: var(--bg-warm); }
.npi-feature h3 { font-size: 1.05rem; font-weight: 700; color: var(--text-dark); margin: 0 0 0.75rem 0; }
.npi-feature p { color: var(--text-muted); line-height: 1.7; margin: 0; font-size: 0.9rem; }
.npi-feature-head { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.npi-feature-num { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.85rem; color: #fff; flex-shrink: 0; }
@media (max-width: 768px) { .npi-card-grid, .npi-panel-grid, .npi-feature-grid { grid-template-columns: 1fr; } }

/* Content lists and FAQ */
.npi-bullets { list-style: disc; padding-left: 1.5rem; margin: 1rem 0; }
.npi-bullets li { margin-bottom: 0.5rem; }

/* Result table (from get-npi-details AJAX) */
.npi-table-header { background-color: #c4d86a; color: #000; text-align: center; }
.npi-table-subheader { background-color: #aeabab; color: #000; text-align: center; }

/* Optional NPI heading aliases (use npi-section-title, npi-heading for new content) */
.npi-section-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 1rem; }
.npi-heading { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.75rem; }

/* ========== Homepage-specific styles ========== */
.hero-subtitle { font-size: 1.1rem; line-height: 1.6; margin-bottom: 1rem; opacity: 0.95; }
.hero-cta-btn { display: inline-flex; align-items: center; padding: 0.65rem 1.5rem; border-radius: 8px; font-weight: 600; text-decoration: none; transition: transform 0.2s, box-shadow 0.2s; }
.hero-cta-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
button.hero-cta-btn { border: none; cursor: pointer; font: inherit; text-align: center; }

/* Section blue - no padding bottom for search tool (legacy) */
.section-blue.no-padding-bottom { padding-bottom: 60px; }

/* ========== Focus visible (accessibility) ========== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:not([tabindex="-1"]):focus-visible {
    outline: 2px solid var(--primary, #1a73e8);
    outline-offset: 2px;
}
.btn:focus-visible,
.nav-link:focus-visible {
    outline: 2px solid var(--primary, #1a73e8);
    outline-offset: 2px;
}

/* ========== Privacy / Terms: article-style prose (narrow column, minimal chrome) ========== */
.legal-page.legal-page--prose {
    /* padding-top: 2.5rem; */
    padding-bottom: 3rem;
}
.legal-page.legal-page--prose .legal-meta {
    margin-bottom: 1.5rem;
    font-size: 0.9375rem;
    color: #5a5a5a;
}
.legal-page.legal-page--prose .legal-meta p {
    margin: 0;
}
/* TOC: plain text block, no card */
.legal-page.legal-page--prose .legal-toc {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0 0 1.5rem 0;
    margin-bottom: 0;
}
.legal-page.legal-page--prose .legal-toc .legal-toc__title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 1rem 0;
    padding: 0;
    border: none;
}
.legal-page.legal-page--prose .legal-toc ol {
    margin: 0;
    padding-left: 1.35rem;
    columns: 1;
    column-gap: 0;
}
@media (min-width: 576px) {
    .legal-page.legal-page--prose .legal-toc ol {
        columns: 2;
        column-gap: 2rem;
    }
}
.legal-page.legal-page--prose .legal-toc li {
    margin-bottom: 0.4rem;
    line-height: 1.45;
}
.legal-page.legal-page--prose .legal-toc ol li a {
    font-size: 0.9375rem;
    font-weight: 500;
    color: #1a73e8;
    text-decoration: none;
}
.legal-page.legal-page--prose .legal-toc ol li a:hover {
    text-decoration: underline;
    color: #1557b0;
}
/* Body: no outer card */
.legal-page.legal-page--prose .legal-content {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
}
/* Sections: no card chrome; subtle divider only between major blocks */
.legal-page.legal-page--prose .content-block {
    margin-top: 0;
    margin-bottom: 0;
    padding: 0;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}
.legal-page.legal-page--prose .content-block + .content-block {
    padding-top: 2.25rem;
    margin-top: 0;
}
.legal-page.legal-page--prose .content-block h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 1rem 0;
    padding: 0 !important;
    border: none !important;
    border-bottom: none !important;
    line-height: 1.35;
}
.legal-page.legal-page--prose .content-block h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #2c2c2c;
    margin: 1.25rem 0 0.5rem 0;
}
.legal-page.legal-page--prose .content-block h3:first-child {
    margin-top: 0;
}
.legal-page.legal-page--prose .content-block p,
.legal-page.legal-page--prose .content-block ul,
.legal-page.legal-page--prose .content-block ol {
    font-size: 1rem;
    line-height: 1.75;
    color: #3c4043;
    margin-bottom: 0.85rem;
}
.legal-page.legal-page--prose .content-block p:last-child,
.legal-page.legal-page--prose .content-block ul:last-child,
.legal-page.legal-page--prose .content-block ol:last-child {
    margin-bottom: 0;
}
.legal-page.legal-page--prose .content-block ul,
.legal-page.legal-page--prose .content-block ol {
    padding-left: 1.35rem;
}
.legal-page.legal-page--prose .content-block li {
    margin-bottom: 0.35rem;
}
.legal-page.legal-page--prose .content-block a {
    color: #1a73e8;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.legal-page.legal-page--prose .content-block a:hover {
    color: #1557b0;
}

/* Conspicuous legal text: uppercase + semibold (full paragraphs / blocks) */
.legal-page.legal-page--prose .legal-caps {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.035em;
    line-height: 1.65;
    font-size: 0.9rem;
}
.legal-page.legal-page--prose .legal-caps a {
    text-transform: none;
    letter-spacing: normal;
    font-weight: 600;
}

/* Contact sidebar: same visual language as About Us (npi-block list) */
.contact-sidebar-lead {
    line-height: 1.65;
}
.contact-sidebar-card .contact-sidebar-sections {
    gap: 1rem;
}
.contact-sidebar-card .contact-sidebar-sections .npi-block {
    margin-bottom: 0;
}
.contact-sidebar-card .contact-sidebar-sections .npi-block p:last-child {
    margin-bottom: 0;
}
.contact-sidebar-reply-line {
    display: inline-block;
    margin-top: 0.35rem;
    font-size: 0.875rem;
    opacity: 0.85;
    color: var(--text-muted, #5a5a5a);
}
.contact-sidebar-card .contact-sidebar-sections .npi-block a[href^="mailto:"] {
    font-weight: 600;
    font-size: 1.05rem;
}

/* API documentation page (/api/) — developer-doc style UI */
/* Chromium: overflow-x:hidden on html/body breaks position:sticky; clip preserves overflow hiding without that bug. */
html.page-api-doc,
body.page-api-doc {
    overflow-x: clip;
}

/* ---- API / downloads doc pages: badges + ghost buttons on gradient hero ---- */
.api-doc-hero-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}
/* Badges on standard gradient hero (readable on blue) */
.page-api-doc .hero.hero-tool .api-doc-badge {
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.28);
}
.page-api-doc .hero.hero-tool .api-doc-btn-ghost {
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.45) !important;
    background: rgba(255, 255, 255, 0.08) !important;
}
.page-api-doc .hero.hero-tool .api-doc-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.18) !important;
    color: #fff !important;
}
.api-doc-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #e2e8f0;
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 999px;
}
.api-doc-badge-method {
    display: inline-block;
    padding: 0.12rem 0.4rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #eff6ff;
    background: var(--npi-doc-accent-hover);
    border-radius: 0.25rem;
}
.api-doc-hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}
.api-doc-btn-primary {
    padding: 0.55rem 1.25rem;
    font-weight: 600;
    color: #ffffff !important;
    background: var(--npi-doc-accent) !important;
    border: none !important;
    border-radius: 0.5rem;
    box-shadow: 0 2px 12px rgba(37, 99, 235, 0.35);
}
.api-doc-btn-primary:hover {
    background: var(--npi-doc-accent-hover) !important;
    color: #ffffff !important;
    transform: translateY(-1px);
}
.api-doc-btn-ghost {
    padding: 0.55rem 1.25rem;
    font-weight: 600;
    color: #e2e8f0 !important;
    background: transparent !important;
    border: 1px solid rgba(148, 163, 184, 0.45) !important;
    border-radius: 0.5rem;
}
.api-doc-btn-ghost:hover {
    background: rgba(248, 250, 252, 0.08) !important;
    border-color: rgba(226, 232, 240, 0.55) !important;
    color: #fff !important;
}

/* ---- Layout & TOC ---- */
.api-doc-page {
    background: linear-gradient(180deg, #f1f5f9 0%, #f8fafc 12rem, #fff 24rem);
}
.api-doc-toc {
    position: sticky;
    top: 1rem;
    z-index: 5;
    padding: 1.15rem 1rem 1.15rem 1.1rem;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
}
.api-doc-toc-title {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 0.85rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid #e2e8f0;
}
.api-doc-toc-list {
    font-size: 0.875rem;
    margin: 0;
    padding: 0;
}
.api-doc-toc-list li {
    margin-bottom: 0.2rem;
}
.api-doc-toc-list a {
    display: block;
    padding: 0.35rem 0.4rem 0.35rem 0.5rem;
    margin-left: -0.25rem;
    border-radius: 0.35rem;
    text-decoration: none;
    color: #334155;
    font-weight: 500;
    border-left: 2px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.api-doc-toc-list a:hover {
    background: #f1f5f9;
    color: var(--npi-doc-accent-ink);
    border-left-color: var(--npi-doc-accent-border);
}
.api-doc-toc-list a.is-active {
    background: var(--npi-doc-accent-soft);
    color: var(--npi-doc-accent-ink-deep);
    border-left-color: var(--npi-doc-accent-bar);
}
.api-doc-toc-list a.is-active:hover {
    background: var(--npi-doc-accent-soft-2);
    color: var(--npi-doc-accent-ink-deep);
    border-left-color: var(--npi-doc-accent);
}
.api-doc-mobile-toc {
    padding: 1rem 1.1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
    margin-bottom: 1.5rem;
}
.api-doc-mobile-toc-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.api-doc-mobile-toc-chips a {
    display: inline-block;
    padding: 0.35rem 0.7rem;
    font-size: 0.8125rem;
    font-weight: 500; /* keep 500 when .is-active so chip width does not jump */
    color: var(--npi-doc-accent-ink);
    background: var(--npi-doc-accent-soft);
    border: 1px solid var(--npi-doc-accent-border-light);
    border-radius: 999px;
    text-decoration: none;
}
.api-doc-mobile-toc-chips a:hover {
    background: var(--npi-doc-accent-soft-2);
    color: var(--npi-doc-accent-ink-deep);
}
.api-doc-mobile-toc-chips a.is-active {
    background: var(--npi-doc-accent-soft-2);
    color: var(--npi-doc-accent-ink-deep);
    border-color: var(--npi-doc-accent-bar);
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.28);
}
.api-doc-mobile-toc-chips a.is-active:hover {
    background: var(--npi-doc-accent-border-light);
    color: var(--npi-doc-accent-ink-deep);
}

/* ---- Content sections ---- */
.api-doc-content {
    max-width: 52rem;
}
.api-doc-section {
    scroll-margin-top: 1.25rem;
    padding-bottom: 2.5rem;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid #e2e8f0;
}
.api-doc-section--last {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.api-doc-h2 {
    font-family: var(--font-display, system-ui, sans-serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    padding-bottom: 0.65rem;
    border-bottom: 2px solid var(--npi-doc-accent);
    display: inline-block;
    width: 100%;
    box-shadow: 0 1px 0 #e2e8f0;
}
.api-doc-h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #1e293b;
    margin-top: 1.5rem;
    margin-bottom: 0.65rem;
}
.api-doc-prose {
    color: #334155;
    line-height: 1.65;
    margin-bottom: 1rem;
}
.api-doc-prose:last-child {
    margin-bottom: 0;
}
.api-doc-lead {
    font-size: 1.05rem;
    line-height: 1.55;
    color: #475569;
    margin-bottom: 1.25rem;
}
.api-doc-inline-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.88em;
    padding: 0.12em 0.35em;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 0.25rem;
    color: #0f172a;
    /* Break long URLs/paths; use --nowrap for header names so hyphens don’t split tokens */
    overflow-wrap: break-word;
    word-break: normal;
}
/* HTTP header names and similar tokens must not wrap at hyphens (e.g. X-Api-Key) */
.api-doc-inline-code--nowrap {
    white-space: nowrap;
    overflow-wrap: normal;
}

.api-doc-callout {
    padding: 1rem 1.15rem;
    border-radius: 0.65rem;
    margin-top: 1rem;
    margin-bottom: 0;
    border: 1px solid #bae6fd;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    color: #0c4a6e;
}
.api-doc-callout strong {
    color: #075985;
}
/* Space between info callout and following checklist (checklist has margin:0 by default) */
.api-doc-callout + .api-doc-checklist {
    margin-top: 1.5rem;
}
/* Callout ↔ prose (e.g. overview host notice → migration line) */
.api-doc-callout + .api-doc-prose {
    margin-top: 1.25rem;
}
.api-doc-prose + .api-doc-callout {
    margin-top: 1.35rem;
}
/* Extra gap: endpoint card → “Try in the browser?” callout */
.api-doc-endpoint-card + .api-doc-callout {
    margin-top: 1.5rem;
}

/* Endpoint card */
.api-doc-endpoint-card {
    margin: 1.25rem 0 1.35rem;
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid #1e293b;
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.12);
}
.api-doc-endpoint-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    background: linear-gradient(90deg, #0f172a 0%, #1e293b 100%);
    border-bottom: 1px solid #334155;
}
.api-doc-method {
    font-size: 0.6875rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    padding: 0.3rem 0.55rem;
    border-radius: 0.3rem;
    text-transform: uppercase;
}
.api-doc-method--get {
    color: #ffffff;
    background: var(--npi-doc-accent);
}
.api-doc-endpoint-path {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #e2e8f0;
}
.api-doc-endpoint-url {
    padding: 1rem 1.1rem;
    background: #0f172a;
}
.api-doc-endpoint-url-label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 0.4rem;
}
.api-doc-endpoint-url-text {
    display: block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--npi-doc-on-dark);
    word-break: break-all;
    background: transparent;
    padding: 0;
}
.api-doc-endpoint-hint {
    padding: 0.75rem 1.1rem;
    font-size: 0.8125rem;
    color: #64748b;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.api-doc-actions-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.api-doc-btn-outline {
    font-weight: 600;
    color: var(--npi-doc-accent-ink) !important;
    border-color: var(--npi-doc-accent-bar) !important;
    border-radius: 0.5rem;
}
.api-doc-btn-outline:hover {
    background: var(--npi-doc-accent-soft) !important;
    color: var(--npi-doc-accent-hover) !important;
}
.api-doc-actions-meta {
    color: #64748b;
}

.api-doc-steps {
    padding-left: 1.25rem;
    margin: 0 0 1rem;
    color: #334155;
    line-height: 1.75;
}
.api-doc-steps li {
    margin-bottom: 0.55rem;
}
.api-doc-steps li:last-child {
    margin-bottom: 0;
}
/* Prose / headings → checklist (e.g. Authentication intro → header list) */
.api-doc-prose + .api-doc-checklist,
.api-doc-h2 + .api-doc-checklist {
    margin-top: 1.1rem;
}
.api-doc-checklist {
    margin: 0 0 1.2rem;
    padding-left: 1.2rem;
    color: #334155;
    line-height: 1.7;
}
.api-doc-section > .api-doc-checklist:last-child {
    margin-bottom: 0;
}
.api-doc-checklist li {
    margin-bottom: 0.65rem;
}
.api-doc-checklist li:last-child {
    margin-bottom: 0;
}

/* Code snippets */
.api-doc-snippet {
    margin-bottom: 1.15rem;
    border-radius: 0.65rem;
    overflow: hidden;
    border: 1px solid #1e293b;
    background: #0f172a;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.1);
}
.api-doc-snippet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.45rem 0.65rem 0.45rem 0.85rem;
    background: #1e293b;
    border-bottom: 1px solid #334155;
}
.api-doc-snippet-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    letter-spacing: 0.02em;
}
.api-doc-copy-btn {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.3rem 0.65rem;
    color: #e2e8f0;
    background: #334155;
    border: 1px solid #475569;
    border-radius: 0.35rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.api-doc-copy-btn:hover:not(:disabled) {
    background: #475569;
    border-color: #64748b;
    color: #fff;
}
.api-doc-copy-btn:disabled {
    opacity: 0.85;
    cursor: default;
}
.api-doc-snippet-code {
    margin: 0;
    padding: 0.85rem 1rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.8125rem;
    line-height: 1.55;
    color: #e2e8f0;
    background: #0f172a;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}
.api-doc-snippet-code code {
    font-size: inherit;
    color: inherit;
    background: transparent;
    padding: 0;
    border: 0;
}

/* Parameters table */
.api-doc-table-wrap {
    border-radius: 0.65rem;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    margin-top: 0;
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.api-doc-prose + .api-doc-table-wrap {
    margin-top: 1.1rem;
}
.api-doc-table-wrap + .api-doc-note {
    margin-top: 1.15rem;
}
.api-doc-table {
    font-size: 0.875rem;
    --bs-table-bg: #fff;
    margin-bottom: 0;
}
.api-doc-table thead th {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #475569;
    background: #f8fafc !important;
    border-bottom: 2px solid #e2e8f0 !important;
    padding: 0.75rem 1rem;
}
.api-doc-table tbody td {
    padding: 0.65rem 1rem;
    vertical-align: top;
    color: #334155;
    border-color: #f1f5f9 !important;
}
.api-doc-table tbody td:first-child {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.8125rem;
    color: #0f172a;
    white-space: nowrap;
    background: #fafafa;
}
.api-doc-table tbody tr:hover td {
    background-color: #f8fafc;
}
.api-doc-table tbody tr:hover td:first-child {
    background: #f1f5f9;
}
.api-doc-note {
    color: #64748b;
    line-height: 1.5;
}
