/* ============================================================
   Checker Developer Portal - Base Styles
   ============================================================ */

/* Brand fonts */
@font-face {
    font-family: 'RM Neue Regular';
    src: url('/static/fonts/pn11oLYj0apfGPtvm2KQNVCvM.woff2') format('woff2');
    font-display: swap;
    font-style: normal;
    font-weight: 400;
}
@font-face {
    font-family: 'Suisse Intl Regular';
    src: url('/static/fonts/TMCw3OS0XIn4lwmXj6iQ4Zh5dkg.woff2') format('woff2');
    font-display: swap;
    font-style: normal;
    font-weight: 400;
}
@font-face {
    font-family: 'Suisse Intl Medium';
    src: url('/static/fonts/ZER4FmG4F4HU6QbDIRkwng7N9HE.woff2') format('woff2');
    font-display: swap;
    font-style: normal;
    font-weight: 500;
}
@font-face {
    font-family: 'Fragment Mono';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url(https://fonts.gstatic.com/s/fragmentmono/v6/4iCr6K5wfMRRjxp0DA6-2CLnB4NHhg.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Design tokens — Checker "Liquidity & Credit" brand (see BRANDING.md) */
:root {
    /* Brand palette */
    --canvas-dark: #0E0E0E;   /* hero band, header, footer, table header rows */
    --accent: #A6C13A;        /* single brand color — CTAs, stats, emphasis */
    --accent-hover: #93AC2F;  /* darkened accent for hover states */
    --accent-muted: #EEF3DC;  /* accent-tinted backgrounds */
    --surface: #FFFFFF;       /* cards / primary content surfaces */
    --surface-muted: #F4F4F4; /* neutral chips, muted sections */
    --border: #E4E4E4;        /* card borders, table rules */
    --text: #1A1A1A;          /* primary body text */
    --text-muted: #6B6B6B;    /* secondary text, captions, eyebrow labels */
    --text-on-dark: #FFFFFF;  /* text on dark canvas */

    /* Legacy aliases — keep existing inline styles/templates working */
    --black: var(--text);
    --white: var(--surface);
    --off-white: var(--surface-muted);
    --light-gray: var(--border);
    --dark-gray: var(--text-muted);
    --medium-gray: #cecfd0;
    --footer-bg: var(--canvas-dark);
    --page-gray: var(--surface-muted);
}

html {
    height: 100%;
    /* Backstop the full-bleed .hero (width:100vw): prevent the scrollbar-gutter
       difference from producing a horizontal scrollbar. */
    overflow-x: hidden;
}
body {
    margin: 0;
    padding: 0;
    /* Sticky footer: column layout so <footer> is pinned to the viewport
       bottom even when page content is short. */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--surface-muted);
    color: var(--text);
    font-family: 'Suisse Intl Regular', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
}
/* The main content region grows to fill the space, pushing the footer down. */
main {
    flex: 1 0 auto;
}

/* Headings */
h1, h2, h3, h4 {
    margin: 0 0 0.5rem 0;
    font-family: 'RM Neue Regular', system-ui, sans-serif;
    font-weight: 400;
    color: var(--black);
    letter-spacing: -0.02em;
}

/* Layout Containers */
.container {
    width: 100%;
    box-sizing: border-box;
    max-width: 960px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Cards */
.card {
    background: var(--white);
    border: 1px solid var(--light-gray);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* Buttons */
.btn {
    background: var(--accent);
    color: var(--canvas-dark);
    border: none;
    border-radius: 6px;
    padding: 14px 18px;
    cursor: pointer;
    font-family: 'Suisse Intl Medium', system-ui, sans-serif;
    font-weight: 500;
    font-size: 14px;
    line-height: 1;
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s, opacity 0.2s, transform 0.1s;
    white-space: nowrap;
}
.btn:hover {
    background: var(--accent-hover);
}
.btn:active {
    transform: scale(0.98);
}
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.btn[aria-busy="true"] {
    cursor: progress;
}
/* Trailing-arrow CTA per brand ("Get in touch →"). Opt-in modifier. */
.btn-cta::after {
    content: " \2192";
}
/* Secondary actions stay monochrome so the green CTA reads as primary. */
.btn-outline {
    background: transparent;
    border: 1px solid rgba(26, 26, 26, 0.2);
    color: var(--text);
}
.btn-outline:hover {
    background: transparent;
    border-color: var(--text);
}
.btn-dark {
    background: var(--canvas-dark);
    color: var(--text-on-dark);
}
.btn-dark:hover {
    background: var(--canvas-dark);
    opacity: 0.88;
}
.btn-light {
    background: var(--surface);
    color: var(--text);
}
.btn-light:hover {
    background: var(--surface);
    opacity: 0.88;
}
/* Outline button for use on the dark hero band */
.btn-outline-light {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: var(--text-on-dark);
}
.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.7);
}

/* Muted Text */
.muted {
    color: var(--dark-gray);
    font-size: 0.95rem;
}

/* Labels (monospace) */
.label {
    font-family: 'Fragment Mono', 'Courier New', monospace;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--dark-gray);
}

/* HTMX Indicators */
.htmx-indicator {
    display: none;
}
.htmx-request .htmx-indicator {
    display: inline;
}

/* Inputs & Forms */
input[type=text],
input[type=email],
textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--light-gray);
    border-radius: 8px;
    padding: 11px 14px;
    font-size: 1rem;
    font-family: 'Suisse Intl Regular', system-ui, sans-serif;
    color: var(--black);
}
input:focus,
textarea:focus {
    outline: none;
    border-color: var(--black);
    box-shadow: none;
}

/* Header & Nav — dark canvas band, matching the Changelog site header */
header {
    background: var(--canvas-dark);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
header .brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-on-dark);
    text-decoration: none;
}
.brand-mark rect {
    fill: #ffffff;
}
.brand-word {
    font-family: 'Suisse Intl Medium', system-ui, sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
}
.brand-eyebrow {
    color: var(--accent);
}
nav a {
    margin-right: 14px;
    text-decoration: none;
    color: var(--accent);
    font-family: 'Suisse Intl Medium', system-ui, sans-serif;
    font-weight: 500;
    font-size: 14px;
    transition: opacity 0.15s;
}
nav a:hover {
    opacity: 0.8;
}

/* Footer */
footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 1.5rem 20px;
    color: var(--text-muted);
    font-family: 'Fragment Mono', 'Courier New', monospace;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Utility */
.prose {
    line-height: 1.7;
    color: var(--text);
}
.prose h2 {
    margin-top: 1.5rem;
    font-family: 'RM Neue Regular', system-ui, sans-serif;
    color: var(--text);
    letter-spacing: -0.02em;
}

/* Eyebrow / section labels — uppercase, letter-spaced, muted gray */
.eyebrow {
    font-family: 'Suisse Intl Medium', system-ui, sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 11px;
    color: var(--text-muted);
}

/* Accent helpers */
.text-accent { color: var(--accent); }
.bg-accent-muted { background: var(--accent-muted); }

/* Stat callouts — large bold accent numerals with a small uppercase caption */
.stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.stat-value {
    font-family: 'RM Neue Regular', system-ui, sans-serif;
    font-size: 2.25rem;
    line-height: 1;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.02em;
}
.stat-caption {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 11px;
    color: var(--text-muted);
}

/* Chips / pills — small uppercase tags */
.chip {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-family: 'Suisse Intl Medium', system-ui, sans-serif;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: var(--surface-muted);
    color: var(--text-muted);
}
.chip-positive {
    background: var(--accent-muted);
    color: #4d5e16;
}

/* Tables — dark header row, light body, optional accent-highlighted column */
table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
table.data th {
    background: var(--canvas-dark);
    color: var(--text-on-dark);
    text-align: left;
    padding: 12px 14px;
    font-family: 'Suisse Intl Medium', system-ui, sans-serif;
    font-weight: 500;
}
table.data td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}
/* Highlight the "Checker" comparison column to draw the eye */
table.data th.col-accent {
    background: var(--accent);
    color: var(--canvas-dark);
}
table.data td.col-accent {
    background: var(--accent-muted);
}

/* ============================================================
   Landing hero — full-bleed dark band
   ============================================================ */
.hero {
    /* Break out of the centered .container to span the viewport */
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-top: -2rem;          /* cancel .container top margin, sit flush under header */
    background: var(--canvas-dark);
    color: var(--text-on-dark);
    padding: 5rem 1.5rem;
}
.hero-inner {
    max-width: 960px;
    margin: 0 auto;
}
.hero .eyebrow {
    color: rgba(255, 255, 255, 0.6);
}
.hero h1 {
    color: var(--text-on-dark);
    font-size: clamp(2.25rem, 5vw, 3.5rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin: 0.75rem 0 1.25rem;
}
/* Mixed-weight display headline: light leading line + bold emphasis line */
.hero h1 .line-light {
    display: block;
    font-weight: 400;
    opacity: 0.85;
}
.hero h1 .line-bold {
    display: block;
    font-weight: 700;
}
.hero-lede {
    max-width: 620px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 1.1rem;
    margin: 0 0 1.75rem;
}
.hero-cta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
/* "Why Checker" feature list, styled for the dark hero band */
.hero-features {
    margin-top: 3rem;
}
.hero-features h2 {
    color: var(--text-on-dark);
    font-size: 1.5rem;
    margin: 0.5rem 0 1rem;
}
.hero-features ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.6rem;
    max-width: 620px;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.6;
}
.hero-features li {
    position: relative;
    padding-left: 1.5rem;
}
.hero-features li::before {
    content: "\2192";          /* accent arrow bullet, matching the CTA */
    position: absolute;
    left: 0;
    color: var(--accent);
}
.hero-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-top: 3.5rem;
    padding-top: 2.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}
.hero-stats .stat-caption {
    color: rgba(255, 255, 255, 0.55);
}
@media (max-width: 640px) {
    .hero { padding: 3rem 1.25rem; }
    .hero-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   Guides (/docs, /docs/:slug)
   ============================================================ */
.guides-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
}
.guides-nav {
    position: sticky;
    top: 1rem;
}
.guides-nav-section { margin-bottom: 1.25rem; }
.guides-nav ul,
.guide-toc ul,
.guides-list {
    list-style: none;
    margin: 0.4rem 0 0;
    padding: 0;
}
.guides-nav li { margin: 0.25rem 0; }
.guides-nav a {
    display: block;
    padding: 4px 8px;
    border-radius: 4px;
    color: var(--text);
    text-decoration: none;
}
.guides-nav a:hover { background: var(--surface-muted); }
.guides-nav a[aria-current="page"] {
    background: var(--accent-muted);
    font-weight: 600;
}
.guides-main { min-width: 0; }
.guides-list li { margin: 0.75rem 0; }
.guide-title {
    margin: 0.25rem 0 1rem;
    font-family: 'RM Neue Regular', system-ui, sans-serif;
    letter-spacing: -0.02em;
}
.guide-toc {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    background: var(--surface-muted);
}
.guide-toc li { margin: 0.2rem 0; }
.guide-toc .toc-l3 { padding-left: 1rem; }
.prose h3 { margin-top: 1.25rem; }
/* Suisse ships a separate Medium face rather than a bold weight; without
   this the browser fakes bold from Regular and it reads lighter, not heavier. */
.prose strong {
    font-family: 'Suisse Intl Medium', system-ui, sans-serif;
    font-weight: 500;
}
.prose pre {
    background: var(--canvas-dark);
    color: #f4f4f4;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    font-family: 'Fragment Mono', ui-monospace, monospace;
    font-size: 0.85rem;
    line-height: 1.5;
}
.prose :not(pre) > code {
    background: var(--surface-muted);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.9em;
    word-break: break-word;
}
.prose table {
    border-collapse: collapse;
    width: 100%;
    margin: 1rem 0;
    display: block;
    overflow-x: auto;
}
.prose th,
.prose td {
    border: 1px solid var(--border);
    padding: 6px 10px;
    text-align: left;
}
.prose th { background: var(--surface-muted); }
@media (max-width: 800px) {
    .guides-layout { grid-template-columns: 1fr; }
    .guides-nav { position: static; }
}

/* ============================================================
   Demo mode (cmd/dev-portal-demo only)
   ============================================================ */
.demo-banner {
    background: var(--accent);
    color: var(--canvas-dark);
    padding: 6px 20px;
    font-size: 0.85rem;
    text-align: center;
}
.demo-banner a { color: var(--canvas-dark); text-decoration: underline; }
.demo-picker { max-width: 720px; margin: 2rem auto; }
.demo-picker h3 { margin-top: 1.5rem; }
.demo-persona-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}
.demo-persona-row > div { min-width: 0; overflow-wrap: anywhere; }
.demo-persona-row .btn { flex-shrink: 0; }
.demo-status {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 11px;
    letter-spacing: 0.04em;
    background: var(--surface-muted);
    color: var(--text-muted);
}
.demo-status-APPROVED { background: var(--accent-muted); color: #4d5c14; }
.demo-status-PENDING { background: #fef3c7; color: #92400e; }
.demo-status-REJECTED { background: #fee2e2; color: #991b1b; }
.demo-note {
    background: var(--accent-muted);
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin: 1rem 0;
}
.demo-hint { margin-top: 1rem; }
.demo-reset { margin-top: 1.5rem; }

/* ============================================================
   Product setup wizard (/setup) and dashboard Products / API keys
   ============================================================ */
:root {
    --warning-bg: #FEF3C7;
    --warning-text: #92400E;
    --danger-bg: #FEE2E2;
    --danger-text: #991B1B;
    --info-bg: #E0ECFF;
    --info-text: #1E3A8A;
    --focus-ring: 0 0 0 3px rgba(166, 193, 58, 0.45);
}

.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Keyboard focus is always visible on the new controls. */
.btn:focus-visible,
.product-card-input:focus-visible + .product-card-check,
.copy-row input:focus-visible,
.field input:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}
.setup-title:focus { outline: none; }

.btn-sm { padding: 8px 12px; font-size: 13px; }
.btn-danger {
    background: transparent;
    border: 1px solid #E8B4B4;
    color: var(--danger-text);
}
.btn-danger:hover { background: var(--danger-bg); }
.htmx-request .btn[type=submit],
.btn.htmx-request { opacity: 0.6; pointer-events: none; }
.inline-form { margin: 0; display: inline; }

/* Callouts */
.callout {
    border-radius: 8px;
    padding: 12px 14px;
    margin: 0 0 1rem;
    font-size: 0.95rem;
    border: 1px solid transparent;
}
.callout-warning { background: var(--warning-bg); color: var(--warning-text); border-color: #F5D58A; }
.callout-error   { background: var(--danger-bg); color: var(--danger-text); border-color: #F3B8B8; }
.callout-success { background: var(--accent-muted); color: #3F4D12; border-color: #D5E3A6; }
.callout .btn { margin-left: 8px; }

/* Forms */
.field { margin: 1rem 0; }
.field label {
    display: block;
    font-family: 'Suisse Intl Medium', system-ui, sans-serif;
    font-size: 0.9rem;
    margin-bottom: 4px;
}
.field-hint { margin: 0 0 6px; color: var(--text-muted); font-size: 0.85rem; }
.field-error { color: var(--danger-text); font-size: 0.875rem; margin: 6px 0; }
.field input[aria-invalid="true"] { border-color: var(--danger-text); }

/* Stepper */
.setup { max-width: 760px; margin: 0 auto; }
.stepper {
    list-style: none;
    margin: 0 0 1.25rem;
    padding: 0;
    display: flex;
    gap: 0.5rem;
    counter-reset: none;
}
.stepper-step {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 8px;
    border-bottom: 3px solid var(--border);
    color: var(--text-muted);
    font-size: 0.9rem;
}
.stepper-step.is-current { border-color: var(--accent); color: var(--text); }
.stepper-step.is-done { border-color: var(--accent-hover); }
.stepper-dot {
    flex-shrink: 0;
    width: 26px; height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    background: var(--surface);
    border: 1px solid var(--border);
}
.stepper-step.is-current .stepper-dot { background: var(--accent); border-color: var(--accent); color: var(--canvas-dark); }
.stepper-step.is-done .stepper-dot { background: var(--accent-muted); border-color: var(--accent); color: #3F4D12; }

.setup-card { padding: 1.75rem; }
.setup-intro { margin-bottom: 1.25rem; }
.setup-title { font-size: 1.75rem; margin-bottom: 0.25rem; }
.setup-section { margin-top: 1.75rem; }
.section-title { font-size: 1.2rem; }
.setup-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

/* Selectable product cards */
.product-fieldset, .capabilities { border: 0; margin: 0; padding: 0; min-width: 0; }
.product-card {
    position: relative;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.product-card:hover { border-color: var(--medium-gray); }
.product-card:has(.product-card-input:checked) { border-color: var(--accent); background: #FBFDF4; }
.product-card.is-locked { cursor: default; background: var(--surface-muted); }
/* The native checkbox stays focusable and announced; the box is drawn. */
.product-card-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.product-card-check {
    flex-shrink: 0;
    width: 20px; height: 20px;
    margin-top: 2px;
    border: 1.5px solid var(--medium-gray);
    border-radius: 5px;
    background: var(--surface);
}
.product-card-input:checked + .product-card-check {
    background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3 3 7-7' fill='none' stroke='%230E0E0E' stroke-width='2'/%3E%3C/svg%3E") center/14px no-repeat;
    border-color: var(--accent);
}
.product-card-input:disabled + .product-card-check { opacity: 0.6; }
.product-card-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.product-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.product-card-title { font-family: 'Suisse Intl Medium', system-ui, sans-serif; font-size: 1rem; }
.product-card-desc { color: var(--text-muted); font-size: 0.9rem; }

.product-group { margin-bottom: 12px; }
.product-group .product-card-parent { margin-bottom: 0; }
.product-group.is-open .product-card-parent { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.capabilities {
    border: 1px solid var(--border);
    border-top: 0;
    border-radius: 0 0 12px 12px;
    padding: 12px 16px 4px 48px;
    background: var(--surface);
}
.capabilities .product-card { padding: 12px; clear: both; }
.option-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; cursor: pointer; }
.option-row.is-locked { cursor: default; color: var(--text-muted); }
.option-row input { width: 18px; height: 18px; accent-color: var(--canvas-dark); flex: none; }
.option-text { display: flex; flex-direction: column; }
.option-desc { font-size: 0.85rem; color: var(--text-muted); }

/* Badges: how long a product takes to enable */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    letter-spacing: 0.04em;
    font-family: 'Suisse Intl Medium', system-ui, sans-serif;
    white-space: nowrap;
}
.badge-instant { background: var(--accent-muted); color: #3F4D12; }
.badge-action  { background: var(--warning-bg); color: var(--warning-text); }
.badge-manual  { background: var(--info-bg); color: var(--info-text); }
.badge-enabled { background: var(--canvas-dark); color: var(--text-on-dark); }

/* Review */
.review-list { list-style: none; margin: 0; padding: 0; }
.review-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}
.review-title { font-family: 'Suisse Intl Medium', system-ui, sans-serif; }
.review-product { flex-direction: column; gap: 6px; }
.review-features { list-style: none; margin: 0; padding: 0; width: 100%; }
.review-feature { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 4px 0; }

/* Product status rows and chips */
.product-list { display: flex; flex-direction: column; }
.product-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}
.product-row:last-child { border-bottom: 0; }
.product-row-main { min-width: 0; }
.product-row-title { font-family: 'Suisse Intl Medium', system-ui, sans-serif; }
.product-row-desc { font-size: 0.875rem; }
.product-row-side { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.status-chip {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-family: 'Suisse Intl Medium', system-ui, sans-serif;
    background: var(--surface-muted);
    color: var(--text-muted);
    white-space: nowrap;
}
.status-active          { background: var(--accent-muted); color: #3F4D12; }
.status-action_required { background: var(--warning-bg); color: var(--warning-text); }
.status-in_progress     { background: var(--info-bg); color: var(--info-text); }
.status-inactive,
.status-failed          { background: var(--danger-bg); color: var(--danger-text); }
/* .status-unavailable keeps the neutral chip: a read failure is not a fault. */
.retry-form { margin-top: 1rem; padding: 12px 14px; border-radius: 8px; background: var(--danger-bg); color: var(--danger-text); }
.retry-form p { margin: 0 0 8px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.card-actions { margin-top: 1rem; }

/* Dashboard header */
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.25rem; }
.dash-title { font-size: 1.9rem; margin: 0; }

/* API keys */
.key-create { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin: 1rem 0; }
.key-create-field { flex: 1 1 240px; margin: 0; }
.key-list { display: flex; flex-direction: column; }
.key-list:not(:empty) ~ .key-empty { display: none; }
.key-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.key-row:last-child { border-bottom: 0; }
.key-row-main { display: flex; flex-direction: column; min-width: 0; }
.key-id { font-family: 'Fragment Mono', ui-monospace, monospace; font-size: 0.875rem; overflow-wrap: anywhere; }
.key-label { font-size: 0.9rem; }
.key-meta { font-size: 0.8rem; }
.key-row-side { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.key-row-error { margin-left: 8px; font-size: 13px; color: var(--danger-text); }
.key-row-error:empty { display: none; }

.key-created {
    border: 2px solid var(--accent);
    border-radius: 12px;
    padding: 1.25rem;
    margin: 1rem 0;
    background: #FBFDF4;
}
.key-created-title { font-size: 1.1rem; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; min-width: 0; background: var(--surface); }
.mono { font-family: 'Fragment Mono', ui-monospace, monospace !important; font-size: 0.875rem !important; }

/* Quick start */
.qs-meta { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; }
.qs-meta dt { color: var(--text-muted); }
.qs-meta dd { margin: 0; overflow-wrap: anywhere; }
.auth-title { font-size: 1rem; margin: 1.25rem 0 0.25rem; }
.auth-table-wrap { overflow-x: auto; }
.auth-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.auth-table th, .auth-table td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--light-gray); }
.auth-table th { color: var(--text-muted); font-weight: 600; }
.auth-table td:first-child { white-space: nowrap; }
.get-started-toggle { margin: 0.5rem 0 1rem; }
.get-started-toggle summary { cursor: pointer; font-weight: 600; }
.key-base-url { margin: 0 0 1rem; }
.qs-links { padding-left: 1.25rem; margin: 0.75rem 0 0; }
.qs-links li { margin: 4px 0; }
pre.code {
    background: var(--canvas-dark);
    color: #F4F4F4;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Fragment Mono', ui-monospace, monospace;
    font-size: 0.8rem;
    line-height: 1.5;
}

@media (max-width: 640px) {
    .stepper-label { font-size: 0.8rem; }
    .setup-card { padding: 1.25rem; }
    .capabilities { padding-left: 16px; }
    .product-row, .key-row, .review-item { flex-direction: column; align-items: flex-start; }
    .product-row-side, .key-row-side { justify-content: flex-start; }
    .setup-actions { justify-content: stretch; }
    .setup-actions .btn { flex: 1; text-align: center; }
    .dash-head { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   Docs pages: Guides hub and API reference
   ============================================================ */
.docs-page { max-width: 960px; margin: 0 auto; }
.page-header { margin: 0.5rem 0 1.75rem; }
.page-title { font-size: 2.25rem; line-height: 1.15; margin: 0.25rem 0 0.75rem; letter-spacing: -0.01em; }
.page-lede { max-width: 640px; margin: 0 0 1.25rem; color: var(--text-muted); font-size: 1.05rem; }
.page-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.docs-section { margin-top: 1.5rem; }
.docs-section .section-title { margin: 0 0 0.5rem; }

.link-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.link-card {
    display: flex; flex-direction: column; gap: 6px;
    padding: 1.25rem; border: 1px solid var(--border); border-radius: 12px;
    background: var(--surface); color: var(--text); text-decoration: none;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.link-card:hover { border-color: var(--accent); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06); transform: translateY(-1px); }
.link-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.link-card-kicker { font-family: 'Fragment Mono', ui-monospace, monospace; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); }
.link-card-title { font-family: 'Suisse Intl Medium', system-ui, sans-serif; font-size: 1.1rem; }
.link-card-desc { color: var(--text-muted); font-size: 0.92rem; line-height: 1.5; }

.guide-list { list-style: none; margin: 0; padding: 0; }
.guide-list li + li { border-top: 1px solid var(--border); }
.guide-list-item { display: flex; flex-direction: column; gap: 2px; padding: 0.85rem 0; color: var(--text); text-decoration: none; }
.guide-list-item:hover .guide-list-title { text-decoration: underline; }
.guide-list-title { font-family: 'Suisse Intl Medium', system-ui, sans-serif; }
.guide-list-desc { color: var(--text-muted); font-size: 0.9rem; }

.reference-card { padding: 1.25rem 1.5rem; }
.reference-card .card-head { margin-bottom: 1rem; flex-wrap: wrap; }
.reference-card .section-title { margin: 0; }
.segmented { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-muted); border: 1px solid var(--border); }
.segmented a { padding: 6px 14px; border-radius: 8px; color: var(--text-muted); text-decoration: none; font-size: 0.9rem; }
.segmented a:hover { color: var(--text); }
.segmented a.is-active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }

nav a.nav-logout { color: #E5484D; }
@media (max-width: 800px) { .link-cards { grid-template-columns: 1fr; } .page-title { font-size: 1.75rem; } }

/* ============================================================
   Polish pass: links, options, quickstart, dashboard
   ============================================================ */
/* Accent green fails contrast as text on white, so content links use its dark shade. */
main a:not(.btn):not(.link-card):not(.guide-list-item):not(.segmented a) { color: #4D5C14; text-decoration-thickness: 1px; text-underline-offset: 2px; }
main a:not(.btn):not(.link-card):not(.guide-list-item):hover { color: #2F3A0A; }
:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 2px; }

.card { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04); }
.card-head h2, .section-title { font-family: 'Suisse Intl Medium', system-ui, sans-serif; font-size: 1.15rem; letter-spacing: -0.005em; }
.card-head { padding-bottom: 0.5rem; margin-bottom: 0.25rem; }

/* Product options: nested panel under the parent card */
.capabilities { padding: 6px 16px 8px 52px; background: #FCFCFA; }
.option-row { padding: 10px 0; border-top: 1px solid var(--border); align-items: flex-start; }
.option-row:first-of-type { border-top: 0; }
.option-row input { accent-color: var(--accent-hover); margin-top: 3px; }
.option-label { font-family: 'Suisse Intl Medium', system-ui, sans-serif; }
.option-row .badge { margin-left: auto; }

/* Quickstart */
.qs-meta { padding: 14px 16px; background: var(--surface-muted); border-radius: 10px; margin: 0.5rem 0 0; align-items: baseline; }
.qs-meta code { font-family: 'Fragment Mono', ui-monospace, monospace; font-size: 0.9rem; }
.auth-title { font-family: 'Suisse Intl Medium', system-ui, sans-serif; font-size: 1.05rem; margin: 1.5rem 0 0.25rem; }
.auth-table-wrap { border: 1px solid var(--border); border-radius: 10px; margin-top: 0.75rem; }
.auth-table th { background: var(--surface-muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; }
.auth-table tr:last-child td { border-bottom: 0; }
.auth-table code { font-family: 'Fragment Mono', ui-monospace, monospace; font-size: 0.85rem; }
.get-started-toggle { border: 1px solid var(--border); border-radius: 10px; padding: 0.75rem 1rem; background: var(--surface); }
.get-started-toggle[open] summary { margin-bottom: 0.5rem; }

/* Dashboard */
.dash-head { margin-bottom: 1.5rem; }
.dash-head + .card, .card + .card { margin-top: 1.25rem; }
.key-create { padding: 1rem; background: var(--surface-muted); border-radius: 10px; margin: 1rem 0; }
.key-create-field label { font-size: 0.85rem; }
.key-row { padding: 14px 0; }
.key-empty { padding: 1.5rem 0 0.5rem; text-align: center; }
.product-row-title { font-size: 1rem; }
.status-chip { white-space: nowrap; }
.key-created-title { font-family: 'Suisse Intl Medium', system-ui, sans-serif; }
.setup-card .setup-title { letter-spacing: -0.01em; }

/* ============================================================
   Dashboard (sandbox console)
   ============================================================ */
.dash { max-width: 1120px; margin: 0 auto; }
.dash-hero {
    display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 2rem;
    padding: 2rem 2.25rem; border-radius: 16px; color: var(--text-on-dark, #fff);
    background:
        radial-gradient(900px 300px at 100% 0%, rgba(166, 193, 58, 0.22), transparent 60%),
        var(--canvas-dark);
}
.env-pill {
    display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85);
}
.env-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(166, 193, 58, 0.25); }
.dash-hero-title { margin: 0.9rem 0 0.4rem; font-size: 2.4rem; line-height: 1.1; letter-spacing: -0.015em; color: #fff; }
.dash-hero-sub { margin: 0 0 1.4rem; max-width: 520px; color: rgba(255, 255, 255, 0.7); }
.dash-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.dash-hero-side {
    align-self: center; padding: 1.25rem; border-radius: 12px;
    background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1);
}
.conn-label { font-family: 'Fragment Mono', ui-monospace, monospace; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255, 255, 255, 0.55); margin-bottom: 6px; }
.conn-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 1.1rem; }
.conn-row code { font-family: 'Fragment Mono', ui-monospace, monospace; font-size: 0.85rem; overflow-wrap: anywhere; color: #fff; }
.conn-note { font-size: 0.9rem; color: rgba(255, 255, 255, 0.75); }
.dash-hero a:not(.btn) { color: var(--accent); }

.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 1.25rem 0; }
.stat-tile { display: flex; flex-direction: column; gap: 2px; padding: 1.1rem 1.25rem; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.stat-tile-value { font-family: 'Suisse Intl Medium', system-ui, sans-serif; font-size: 1.75rem; line-height: 1.2; letter-spacing: -0.01em; }
.stat-tile-of { color: var(--text-muted); font-size: 1.1rem; }
.stat-tile-label { color: var(--text-muted); font-size: 0.85rem; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.25rem; align-items: start; }
.dash-main, .dash-side { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; }
.dash-main .card, .dash-side .card { margin: 0; }
.card-sub { margin: 0 0 1rem; font-size: 0.92rem; }
.side-title { font-family: 'Suisse Intl Medium', system-ui, sans-serif; font-size: 1rem; margin: 0 0 0.9rem; }

.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.check-item { display: flex; align-items: center; gap: 12px; font-size: 0.95rem; }
.check-dot { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; border: 1px solid var(--border); color: var(--text-muted); background: var(--surface); }
.check-item.is-done .check-dot { background: var(--accent); border-color: var(--accent); color: var(--canvas-dark); }
.check-item.is-done > span:last-child { color: var(--text-muted); }

.resource-list { list-style: none; margin: 0; padding: 0; }
.resource-list li + li { border-top: 1px solid var(--border); }
.main .resource, .resource { display: flex; flex-direction: column; gap: 2px; padding: 0.75rem 0; text-decoration: none; }
.resource-title { font-family: 'Suisse Intl Medium', system-ui, sans-serif; }
.resource-desc { color: var(--text-muted); font-size: 0.85rem; }
.resource:hover .resource-title { text-decoration: underline; }

/* Code samples */
.code-tabs { border-radius: 12px; overflow: hidden; background: #111; }
.tablist { display: flex; align-items: center; gap: 4px; padding: 8px 10px; background: #1b1b1b; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.tab { border: 0; background: transparent; color: rgba(255, 255, 255, 0.6); padding: 6px 12px; border-radius: 8px; font: inherit; font-size: 0.85rem; cursor: pointer; }
.tab:hover { color: #fff; }
.tab.is-active { background: rgba(255, 255, 255, 0.1); color: #fff; }
.tab-copy { margin-left: auto; }
.code-panel { margin: 0; padding: 1rem 1.25rem; overflow-x: auto; color: #E8E8E8; font-family: 'Fragment Mono', ui-monospace, monospace; font-size: 0.8rem; line-height: 1.65; }
.code-panel[hidden] { display: none; }
.code-foot { margin: 0.9rem 0 0; }
.btn-outline-light.btn-sm { padding: 6px 12px; }

/* Keys and products as clean list rows */
.key-row { align-items: center; }
.key-id { font-size: 0.9rem; }
.key-row-main { gap: 2px; }
.product-row { align-items: center; }

/* ============================================================
   API reference hub
   ============================================================ */
.ref-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 1.5rem; }
.ref-fact { display: flex; flex-direction: column; gap: 6px; padding: 1rem 1.25rem; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; font-size: 0.92rem; }
.ref-fact-label { font-family: 'Fragment Mono', ui-monospace, monospace; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); }
.copy-inline { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.copy-inline code { font-family: 'Fragment Mono', ui-monospace, monospace; font-size: 0.82rem; overflow-wrap: anywhere; }

.ref-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 1rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 0.88rem; cursor: pointer; }
.chip-btn:hover { border-color: var(--accent-hover); }
.chip-btn.is-active { background: var(--canvas-dark); border-color: var(--canvas-dark); color: #fff; }
.search input { min-width: 280px; padding: 9px 14px; border: 1px solid var(--border); border-radius: 10px; font: inherit; font-size: 0.92rem; background: var(--surface); }

.api-card { margin: 0 0 1.25rem; padding: 1.5rem; }
.api-card[hidden], .ref-group[hidden], .endpoint[hidden] { display: none; }
.api-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.api-card-title { font-size: 1.5rem; margin: 0.15rem 0 0; letter-spacing: -0.01em; }
.api-card-desc { max-width: 720px; margin: 0.75rem 0; color: var(--text-muted); }
.tag-row { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 1.25rem; padding: 0; }
.tag { padding: 3px 10px; border-radius: 999px; background: var(--accent-muted); color: #3F4D12; font-size: 0.8rem; }
.ref-group { border-top: 1px solid var(--border); padding: 0.25rem 0; }
.ref-group summary { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 0.7rem 0; font-family: 'Suisse Intl Medium', system-ui, sans-serif; }
.ref-count { padding: 0 8px; border-radius: 999px; background: var(--surface-muted); color: var(--text-muted); font-size: 0.75rem; font-family: 'Suisse Intl Regular', system-ui, sans-serif; }
.endpoint-list { list-style: none; margin: 0 0 0.5rem; padding: 0; }
.endpoint { display: grid; grid-template-columns: 64px minmax(0, 1.4fr) minmax(0, 1fr); align-items: center; gap: 12px; padding: 8px 10px; border-radius: 8px; }
.endpoint:hover { background: var(--surface-muted); }
.endpoint-path { font-family: 'Fragment Mono', ui-monospace, monospace; font-size: 0.82rem; overflow-wrap: anywhere; }
.endpoint-summary { color: var(--text-muted); font-size: 0.9rem; }
.method { display: inline-block; text-align: center; padding: 2px 0; border-radius: 6px; font-family: 'Fragment Mono', ui-monospace, monospace; font-size: 11px; letter-spacing: 0.04em; }
.method-GET { background: #E3F0FF; color: #1D4F91; }
.method-POST { background: var(--accent-muted); color: #3F4D12; }
.method-PUT, .method-PATCH { background: #FFF1D6; color: #8A5A00; }
.method-DELETE { background: #FDE2E2; color: #9B1C1C; }
.endpoint-name { grid-column: 1 / 3; font-family: 'Suisse Intl Medium', system-ui, sans-serif; }
.ref-empty { padding: 2rem 0; text-align: center; }
.callout-band { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; margin-top: 1.5rem; padding: 1.5rem 1.75rem; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.callout-band .section-title { margin: 0 0 0.25rem; }
.callout-band p { margin: 0; }

@media (max-width: 900px) {
    .dash-hero, .dash-grid { grid-template-columns: 1fr; }
    .stat-row, .ref-facts { grid-template-columns: 1fr; }
    .endpoint { grid-template-columns: 56px minmax(0, 1fr); }
    .endpoint-summary { grid-column: 2; }
    .search input { min-width: 0; width: 100%; }
    .search { flex: 1 1 100%; }
    .dash-hero { padding: 1.5rem; }
    .dash-hero-title { font-size: 1.9rem; }
}
main a.resource, main .resource { color: var(--text); }
main .dash-hero a:not(.btn) { color: var(--accent); }
.dash-hero .btn-outline-light { color: #fff; }
main a.on-dark:not(.btn):not(.link-card):not(.guide-list-item) { color: var(--accent); }
.ref-group summary::marker { color: var(--text-muted); }
.qs-more { margin: 0.75rem 0 0; font-size: 0.9rem; }
.auth-table td:first-child { width: 110px; }
.auth-table code + code { margin-left: 4px; }

/* Temporary notification at the top of the page; fades itself out. */
.toast {
    position: fixed; top: 84px; left: 50%; transform: translateX(-50%); z-index: 50;
    display: flex; align-items: center; gap: 12px; max-width: min(640px, calc(100vw - 32px));
    padding: 12px 14px 12px 16px; border-radius: 12px;
    background: #fff; color: var(--text); border: 1px solid var(--border); border-left: 4px solid var(--accent); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
    animation: toast-in 0.25s ease-out, toast-out 0.4s ease-in 9s forwards;
}
.toast-icon { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--canvas-dark); font-size: 13px; }
.toast-text { font-size: 0.95rem; line-height: 1.4; }
.toast-close { flex: none; border: 0; background: transparent; color: var(--text-muted); font-size: 1.25rem; line-height: 1; cursor: pointer; padding: 0 4px; }
.toast-close:hover { color: var(--text); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -12px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes toast-out { to { opacity: 0; visibility: hidden; transform: translate(-50%, -12px); } }
@media (prefers-reduced-motion: reduce) { .toast { animation: toast-out 0.01s linear 9s forwards; } }

/* Review step: one card per product */
.review-list { display: flex; flex-direction: column; gap: 12px; }
.review-item { border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; background: var(--surface); }
.review-product { align-items: stretch; gap: 12px; }
.review-head { display: flex; align-items: flex-start; gap: 12px; }
.review-icon { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-muted); color: #3F4D12; }
.review-desc { font-size: 0.88rem; line-height: 1.45; margin-top: 2px; }
.review-features { padding: 10px 0 0 48px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.review-feature { justify-content: flex-start; gap: 10px; padding: 2px 0; }
.review-check { flex: none; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; background: var(--accent); color: var(--canvas-dark); }
@media (max-width: 800px) { .review-features { padding-left: 0; } }
.review-features { width: auto; box-sizing: border-box; }

/* ============================================================
   Admin · Sandbox requests
   ============================================================ */
.sr { max-width: 1040px; margin: 0 auto; }
.sr-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.sr-back { font-size: 0.85rem; text-decoration: none; color: var(--text-muted); }
.sr-back:hover { color: var(--text); }
.sr-title { font-family: 'Suisse Intl Medium', system-ui, sans-serif; font-size: 1.85rem; letter-spacing: -0.015em; margin: 0.35rem 0 0.25rem; }
.sr-lede { margin: 0; color: var(--text-muted); font-size: 0.95rem; }

.sr-search { position: relative; display: flex; align-items: center; width: min(340px, 100%); }
.sr-search svg { position: absolute; left: 12px; color: var(--text-muted); pointer-events: none; }
.sr-search input { width: 100%; padding: 10px 40px 10px 36px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font-size: 0.9rem; color: var(--text); transition: border-color .15s, box-shadow .15s; }
.sr-search input:focus-visible { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
.sr-search kbd { position: absolute; right: 10px; font: 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text-muted); border: 1px solid var(--border); border-radius: 4px; padding: 3px 6px; background: var(--surface-muted); }

.sr-flash { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 10px; margin-bottom: 1rem; font-size: 0.9rem; border: 1px solid; }
.sr-flash-ok { background: var(--accent-muted); color: #3F4D12; border-color: #D5E3A6; }
.sr-flash-err { background: var(--danger-bg); color: var(--danger-text); border-color: #F3B8B8; }
.sr-flash-x { border: 0; background: none; font-size: 1.2rem; line-height: 1; color: inherit; opacity: .6; cursor: pointer; padding: 0 2px; }
.sr-flash-x:hover { opacity: 1; }

.sr-tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-muted); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 1.25rem; max-width: 100%; overflow-x: auto; }
.sr-tab { display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; padding: 8px 14px; border-radius: 9px; font: inherit; font-size: 0.9rem; color: var(--text-muted); cursor: pointer; white-space: nowrap; transition: background .15s, color .15s, box-shadow .15s; }
.sr-tab:hover { color: var(--text); }
.sr-tab[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 0 0 1px var(--border); }
.sr-tab:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.sr-tab-count { min-width: 22px; padding: 1px 7px; border-radius: 999px; font-size: 12px; text-align: center; background: var(--border); color: var(--text-muted); }
#tab-waiting .sr-tab-count { background: var(--warning-bg); color: var(--warning-text); }

.sr-panel { display: grid; gap: 12px; margin-bottom: 2rem; }
.sr-panel[hidden], .sr-card[hidden], .sr-nomatch[hidden] { display: none; }
.sr-panel-title { font-family: 'Suisse Intl Medium', system-ui, sans-serif; font-size: 1.05rem; margin: 0.5rem 0 0; }
.sr-js .sr-panel-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.sr-panel-note { margin: -4px 0 4px; font-size: 0.85rem; color: var(--text-muted); }
.sr-nomatch { margin: 0; padding: 1.5rem; text-align: center; color: var(--text-muted); font-size: 0.9rem; }
.sr-empty { display: flex; align-items: center; gap: 14px; padding: 1.75rem; border: 1px dashed var(--border); border-radius: 14px; color: var(--text-muted); background: var(--surface); }
.sr-empty p { margin: 0; line-height: 1.5; }
.sr-empty strong { color: var(--text); }
.sr-empty-icon { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-muted); color: #3F4D12; font-weight: 600; flex: none; }

.sr-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 1px 2px rgba(0,0,0,.04); transition: box-shadow .2s, border-color .2s; scroll-margin: 96px; }
.sr-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.06); }
.sr-card.is-pending { border-left: 3px solid #E8B63A; }
.sr-card.sr-flash-target { animation: sr-glow 2.4s ease-out; }
@keyframes sr-glow { 0%, 30% { box-shadow: 0 0 0 3px rgba(166,193,58,.55); } 100% { box-shadow: 0 1px 2px rgba(0,0,0,.04); } }
.sr-card-head { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.sr-avatar { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex: none; font: 600 14px/1 'Suisse Intl Medium', system-ui, sans-serif; letter-spacing: .02em; background: var(--canvas-dark); color: var(--accent); }
.sr-org { flex: 1; min-width: 0; }
.sr-org-name { margin: 0; font-family: 'Suisse Intl Medium', system-ui, sans-serif; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-org-meta { margin: 3px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--text-muted); }
.sr-id { border: 1px solid transparent; background: var(--surface-muted); border-radius: 6px; padding: 1px 6px; font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text-muted); cursor: copy; }
.sr-id:hover { border-color: var(--border); color: var(--text); }
.sr-card-side { display: flex; align-items: center; gap: 12px; flex: none; }
.sr-progress { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--warning-text); font-variant-numeric: tabular-nums; }
.sr-progress.is-done { color: #3F4D12; }
.sr-progress-bar { width: 56px; height: 6px; border-radius: 999px; background: var(--surface-muted); overflow: hidden; }
.sr-progress-bar > span { display: block; height: 100%; border-radius: inherit; background: #E8B63A; }
.sr-progress.is-done .sr-progress-bar > span { background: var(--accent); }

.sr-menu { position: relative; }
.sr-menu > summary { list-style: none; cursor: pointer; }
.sr-menu > summary::-webkit-details-marker { display: none; }
.sr-menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 260px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.12); display: grid; gap: 2px; }
.sr-menu-list form { margin: 0; }
.sr-menu-item { width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 9px 10px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 0.9rem; text-align: left; color: var(--text); cursor: pointer; }
.sr-menu-item small { color: var(--text-muted); font-size: 0.75rem; }
.sr-menu-item:hover, .sr-menu-item:focus-visible { background: var(--surface-muted); outline: none; }
.sr-menu-item:disabled { opacity: .6; cursor: progress; }

.sr-features { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.sr-feature + .sr-feature { border-top: 1px solid var(--border); }
.sr-feature-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 12px 18px 12px 72px; }
.sr-feature-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.sr-feature-label { font-size: 0.92rem; }
.sr-feature.is-canceled .sr-feature-label { color: var(--text-muted); text-decoration: line-through; }
.sr-tag { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--surface-muted); color: var(--text-muted); border: 1px solid var(--border); }
.sr-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; white-space: nowrap; }
.sr-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.sr-pill-ok { background: var(--accent-muted); color: #3F4D12; }
.sr-pill-wait { background: var(--warning-bg); color: var(--warning-text); }
.sr-pill-off { background: var(--surface-muted); color: var(--text-muted); }
.sr-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-width: 210px; }
.sr-actions form { margin: 0; }
.sr-quiet { border: 0; background: none; padding: 6px 4px; font: inherit; font-size: 0.82rem; color: var(--text-muted); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--border); }
.sr-quiet:hover { color: var(--danger-text); text-decoration-color: currentColor; }
.sr-quiet:disabled { cursor: progress; opacity: .7; }
.sr-provision { margin: 0 18px 14px 72px; padding: 14px 16px; border-radius: 10px; background: var(--surface-muted); border: 1px solid var(--border); }
.sr-js .sr-provision:not(.is-open) { display: none; }
.sr-fees > summary { cursor: pointer; color: var(--text-muted); }

.sr-dialog { border: 0; border-radius: 16px; padding: 0; width: min(440px, calc(100vw - 32px)); box-shadow: 0 24px 64px rgba(0,0,0,.22); }
.sr-dialog::backdrop { background: rgba(14,14,14,.45); backdrop-filter: blur(2px); }
.sr-dialog-inner { padding: 22px 22px 18px; }
.sr-dialog-title { margin: 0 0 6px; font-family: 'Suisse Intl Medium', system-ui, sans-serif; font-size: 1.1rem; }
.sr-dialog-body { margin: 0 0 18px; color: var(--text-muted); font-size: 0.92rem; line-height: 1.5; }
.sr-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* Provisioning forms (USD accounts, AxisFi). */
.req-form { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.req-label { display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; color: var(--text-muted); width: 100%; max-width: 420px; }
.req-input { padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; font-size: 0.9rem; color: var(--text); background: var(--surface); width: 100%; box-sizing: border-box; }
.req-input:focus-visible { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
.req-fields { display: grid; gap: 8px; width: 100%; max-width: 420px; }
.req-small { font-size: 0.8rem; margin: 0; }
.req-setup { margin-top: 0.75rem; }
.req-setup > summary { list-style: none; cursor: pointer; display: inline-block; }
.req-setup > summary::-webkit-details-marker { display: none; }
.req-setup[open] > summary { margin-bottom: 0.6rem; }
.req-link { font-size: 0.8rem; color: var(--text-muted); text-decoration: underline; }
.req-steps { margin: 0 0 0 1.1rem; padding: 0; font-size: 0.85rem; line-height: 1.5; display: grid; gap: 6px; max-width: 720px; }
.req-copy { margin: 4px 0; }
.req-copy input { padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.req-fees { border-collapse: collapse; margin-top: 6px; font-size: 0.75rem; }
.req-fees td { padding: 2px 10px 2px 0; }

@media (max-width: 720px) {
    .sr-card-head { flex-wrap: wrap; }
    .sr-card-side { width: 100%; justify-content: space-between; }
    .sr-feature-row { grid-template-columns: minmax(0, 1fr) auto; padding-left: 18px; }
    .sr-actions { grid-column: 1 / -1; justify-content: flex-start; min-width: 0; }
    .sr-provision { margin-left: 18px; }
}
