/* ═══════════════════════════════════════════════════════════
   MERCHANT API  —  Sunset Orange Brand
   Matches wallet.css conventions & same :root variables
   ═══════════════════════════════════════════════════════════ */


/* ── API Hero ─────────────────────────────────────────────── */
.api-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    background: linear-gradient(135deg, var(--brand-secondary) 0%, var(--brand-secondary-light) 60%, #2C2C46 100%);
    background-image:
        radial-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
        linear-gradient(135deg, var(--brand-secondary) 0%, var(--brand-secondary-light) 60%, #2C2C46 100%);
    background-size: 20px 20px, auto;
    border-radius: 24px;
    padding: 36px 40px;
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.api-hero::after {
    content: '';
    position: absolute;
    top: -80px;
    right: -60px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(242, 166, 90, 0.14) 0%, transparent 70%);
    pointer-events: none;
}

.api-hero-main {
    position: relative;
    z-index: 1;
    flex: 1;
}

.api-hero-eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    opacity: 0.75;
    letter-spacing: 0.08em;
    margin-bottom: 14px;
}

.hero-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--brand-primary);
    box-shadow: 0 0 8px rgba(242, 166, 90, 0.7);
    flex-shrink: 0;
}

.api-hero-title {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -1px;
    margin-bottom: 10px;
}

.api-hero-accent {
    color: var(--brand-primary);
}

.api-hero-sub {
    font-size: 0.875rem;
    opacity: 0.55;
    line-height: 1.65;
    max-width: 480px;
    margin-bottom: 20px;
}

.api-hero-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.api-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .12);
    color: rgba(255, 255, 255, .75);
    padding: 6px 13px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.api-pill i {
    font-size: 0.85rem;
    color: var(--brand-primary);
}

/* Hero stats */
.api-hero-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.hero-stat {
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 16px;
    padding: 14px 20px;
    text-align: center;
    min-width: 140px;
}

.hero-stat-val {
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1;
    margin-bottom: 4px;
}

.up-arrow {
    font-size: 0.85rem;
    color: var(--brand-teal);
    vertical-align: super;
}

.hero-stat-lbl {
    font-size: 0.68rem;
    opacity: 0.45;
}


/* ── Usage Stats Row ──────────────────────────────────────── */
.api-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.api-stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 20px;
    box-shadow: var(--shadow-xs);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.api-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-sm);
}

.asc-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.asc-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.asc-icon.teal {
    background: var(--brand-teal-soft);
    color: var(--brand-teal);
}

.asc-icon.orange {
    background: var(--brand-primary-soft);
    color: var(--brand-primary);
}

.asc-icon.warning {
    background: rgba(245, 158, 11, .1);
    color: var(--warning);
}

.asc-trend {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 50px;
}

.asc-trend.up {
    background: var(--brand-teal-soft);
    color: var(--brand-teal);
}

.asc-trend.down {
    background: rgba(239, 68, 68, .1);
    color: var(--danger);
}

.asc-val {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -1px;
    line-height: 1;
    margin-bottom: 4px;
}

.asc-lbl {
    font-size: 0.72rem;
    color: var(--text-muted);
}


/* ── Section Shared ───────────────────────────────────────── */
.section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.section-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 4px;
}

.section-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
}


/* ── Buttons ──────────────────────────────────────────────── */
.btn-primary {
    background: var(--brand-primary);
    color: var(--white);
    padding: 12px 20px;
    border-radius: 12px;
    border: none;
    font-weight: 700;
    font-size: 0.875rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    box-shadow: var(--glow-orange);
    transition: all .18s;
}

.btn-primary:hover {
    background: var(--brand-primary-deep);
    transform: translateY(-1px);
}

.btn-primary-sm {
    background: var(--brand-primary);
    color: var(--white);
    padding: 9px 16px;
    border-radius: 10px;
    border: none;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: var(--glow-orange);
    transition: all .18s;
    flex-shrink: 0;
}

.btn-primary-sm:hover {
    background: var(--brand-primary-deep);
}

.btn-ghost-sm {
    padding: 8px 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--white);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all .18s;
    flex-shrink: 0;
}

.btn-ghost-sm:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    background: var(--brand-primary-soft);
}

.btn-cancel {
    padding: 10px 18px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--white);
    cursor: pointer;
    transition: all .18s;
}

.btn-cancel:hover {
    border-color: var(--danger);
    color: var(--danger);
}


/* ── API Keys Section ─────────────────────────────────────── */
.api-keys-section {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 28px;
    box-shadow: var(--shadow-xs);
}

.keys-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 14px;
}

.key-card {
    border: 1.5px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    transition: box-shadow .2s;
}

.key-card:hover {
    box-shadow: var(--shadow-sm);
}

.key-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 18px;
    background: var(--bg-main);
    border-bottom: 1px solid var(--border);
}

.kc-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.kc-dot.live {
    background: var(--brand-teal);
    box-shadow: 0 0 6px rgba(16, 185, 129, .5);
}

.kc-dot.test {
    background: var(--warning);
}

.kc-env {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    flex: 1;
}

.kc-badge {
    font-size: 0.6rem;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 50px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.kc-badge.live {
    background: var(--brand-teal-soft);
    color: var(--brand-teal);
    border: 1px solid rgba(16, 185, 129, .2);
}

.kc-badge.test {
    background: rgba(245, 158, 11, .1);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, .2);
}

.key-card-body {
    padding: 18px;
}

.kc-label {
    font-size: 0.63rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 7px;
}

.kc-row {
    display: flex;
    align-items: center;
    gap: 7px;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 9px 12px;
    margin-bottom: 14px;
}

.kc-val {
    font-family: 'Courier New', monospace;
    font-size: 0.78rem;
    color: var(--text-main);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: 0.04em;
}

.kc-icon-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    flex-shrink: 0;
    transition: all .15s;
}

.kc-icon-btn:hover {
    background: var(--brand-primary-soft);
    color: var(--brand-primary);
    border-color: var(--brand-primary);
}

.kc-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.kc-meta-row strong {
    color: var(--text-main);
    font-weight: 600;
}

.kc-actions {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

.kc-btn {
    flex: 1;
    padding: 8px;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all .15s;
}

.kc-btn.regen {
    background: var(--brand-primary-soft);
    color: var(--brand-primary);
    border: 1.5px solid rgba(242, 166, 90, .25);
}

.kc-btn.regen:hover {
    background: var(--brand-primary);
    color: var(--white);
    box-shadow: var(--glow-orange);
}

.kc-btn.revoke {
    background: rgba(239, 68, 68, .08);
    color: var(--danger);
    border: 1.5px solid rgba(239, 68, 68, .18);
}

.kc-btn.revoke:hover {
    background: var(--danger);
    color: var(--white);
}

.new-key-btn {
    width: 100%;
    padding: 13px;
    border: 2px dashed var(--border);
    border-radius: 14px;
    background: transparent;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--brand-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: all .18s;
}

.new-key-btn:hover {
    border-color: var(--brand-primary);
    background: var(--brand-primary-soft);
}


/* ── Two Column Grid ──────────────────────────────────────── */
.two-col-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}


/* ── Panel ────────────────────────────────────────────────── */
.panel {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-xs);
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 22px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-main);
}

.panel-head-left {
    display: flex;
    align-items: center;
    gap: 11px;
}

.panel-ico {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--brand-primary-soft);
    color: var(--brand-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.panel-title {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--text-main);
}

.panel-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.panel-body {
    padding: 18px 22px;
}


/* ── Endpoints ────────────────────────────────────────────── */
.endpoint-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.ep-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 13px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all .18s;
}

.ep-item:hover {
    border-color: var(--brand-primary);
    background: var(--brand-primary-soft);
    transform: translateX(3px);
}

.ep-item.active {
    border-color: var(--brand-primary);
    background: var(--brand-primary-soft);
    box-shadow: var(--glow-orange);
}

.ep-method {
    font-family: 'Courier New', monospace;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    min-width: 42px;
    text-align: center;
    flex-shrink: 0;
}

.ep-method.get  { background: #EFF6FF; color: #2563EB; }
.ep-method.post { background: var(--brand-teal-soft); color: var(--brand-teal); }
.ep-method.del  { background: rgba(239, 68, 68, .1); color: var(--danger); }
.ep-method.put  { background: rgba(245, 158, 11, .1); color: var(--warning); }

.ep-path {
    font-family: 'Courier New', monospace;
    font-size: 0.76rem;
    color: var(--text-main);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ep-desc {
    font-size: 0.66rem;
    color: var(--text-muted);
    margin-top: 1px;
}

.ep-new-badge {
    font-size: 0.58rem;
    font-weight: 800;
    background: var(--brand-teal-soft);
    color: var(--brand-teal);
    padding: 2px 7px;
    border-radius: 50px;
    flex-shrink: 0;
}


/* ── Code Block ───────────────────────────────────────────── */
.code-lang-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    background: #0D1117;
    overflow-x: auto;
}

.lang-tab {
    padding: 10px 18px;
    font-size: 0.77rem;
    font-weight: 700;
    color: rgba(255, 255, 255, .4);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}

.lang-tab:hover {
    color: rgba(255, 255, 255, .75);
}

.lang-tab.active {
    color: var(--brand-primary);
    border-bottom-color: var(--brand-primary);
}

.code-block {
    background: #0D1117;
    padding: 20px;
    overflow-x: auto;
    min-height: 220px;
}

.code-block pre {
    margin: 0;
    font-family: 'Courier New', monospace;
    font-size: 0.78rem;
    line-height: 1.8;
    color: #E6EDF3;
    white-space: pre;
}

/* Syntax highlight tokens */
.kw  { color: #FF7B72; }
.str { color: #A5D6FF; }
.cm  { color: #8B949E; font-style: italic; }
.fn  { color: #D2A8FF; }
.prop{ color: #79C0FF; }
.num { color: #F2CC60; }
.op  { color: #E6EDF3; }


/* ── Webhooks ─────────────────────────────────────────────── */
.webhook-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wh-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    transition: all .15s;
}

.wh-item:hover {
    border-color: var(--brand-primary);
    background: var(--brand-primary-soft);
}

.wh-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.wh-dot.active   { background: var(--brand-teal); box-shadow: 0 0 6px rgba(16,185,129,.5); }
.wh-dot.inactive { background: var(--text-muted); }

.wh-url {
    font-family: 'Courier New', monospace;
    font-size: 0.74rem;
    color: var(--text-main);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wh-events {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.wh-ev-tag {
    font-size: 0.58rem;
    font-weight: 700;
    background: var(--brand-secondary-soft);
    color: var(--brand-secondary);
    padding: 2px 7px;
    border-radius: 50px;
    border: 1px solid var(--border);
}

.wh-toggle {
    width: 38px;
    height: 21px;
    border-radius: 50px;
    border: none;
    background: var(--border);
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    transition: background .2s;
}

.wh-toggle.on {
    background: var(--brand-teal);
}

.wh-toggle::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--white);
    transition: transform .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

.wh-toggle.on::after {
    transform: translateX(17px);
}

.dashed-add-btn {
    width: 100%;
    padding: 11px;
    border: 2px dashed var(--border);
    border-radius: 12px;
    background: transparent;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--brand-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
    transition: all .18s;
}

.dashed-add-btn:hover {
    border-color: var(--brand-primary);
    background: var(--brand-primary-soft);
}


/* ── Request Log ──────────────────────────────────────────── */
.log-search-row {
    margin-bottom: 12px;
}

.log-search-box {
    display: flex;
    align-items: center;
    gap: 7px;
    background: var(--bg-main);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 9px 13px;
    transition: border-color .15s;
}

.log-search-box:focus-within {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(242, 166, 90, .1);
}

.log-search-box i {
    font-size: 0.9rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.log-search-box input {
    border: none;
    outline: none;
    font-size: 0.82rem;
    color: var(--text-main);
    background: none;
    flex: 1;
}

.log-search-box input::placeholder {
    color: var(--text-muted);
}

.log-table-wrap {
    overflow-x: auto;
}

.log-table {
    width: 100%;
    border-collapse: collapse;
}

.log-table th {
    font-size: 0.63rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 7px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.log-table td {
    font-size: 0.77rem;
    padding: 9px 10px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.log-table tr:last-child td {
    border-bottom: none;
}

.log-table tr:hover td {
    background: var(--brand-primary-soft);
}

.log-method {
    font-family: 'Courier New', monospace;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 5px;
}

.log-method.get  { background: #EFF6FF; color: #2563EB; }
.log-method.post { background: var(--brand-teal-soft); color: var(--brand-teal); }

.log-path {
    font-family: 'Courier New', monospace;
    font-size: 0.72rem;
    color: var(--text-main);
}

.log-status {
    font-family: 'Courier New', monospace;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 5px;
}

.log-status.s200 { background: var(--brand-teal-soft); color: var(--brand-teal); }
.log-status.s400 { background: rgba(245, 158, 11, .1); color: var(--warning); }
.log-status.s401 { background: rgba(239, 68, 68, .1); color: var(--danger); }
.log-status.s500 { background: rgba(239, 68, 68, .1); color: var(--danger); }

.log-latency {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.log-latency.slow {
    color: var(--warning);
    font-weight: 700;
}

.log-time {
    font-size: 0.68rem;
    color: var(--text-muted);
    white-space: nowrap;
}


/* ── SDK Section ──────────────────────────────────────────── */
.sdk-section {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 28px;
    box-shadow: var(--shadow-xs);
}

.sdk-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.sdk-card {
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 18px;
    text-align: center;
    cursor: pointer;
    transition: all .18s;
    background: var(--bg-main);
}

.sdk-card:hover {
    border-color: var(--brand-primary);
    background: var(--brand-primary-soft);
    transform: translateY(-3px);
    box-shadow: var(--shadow-sm);
}

.sdk-card.active {
    border-color: var(--brand-primary);
    background: var(--brand-primary-soft);
    box-shadow: var(--glow-orange);
}

.sdk-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

.sdk-name {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 2px;
}

.sdk-ver {
    font-size: 0.66rem;
    color: var(--text-muted);
}


/* ── Rate Limits ──────────────────────────────────────────── */
.rate-section {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 28px;
    box-shadow: var(--shadow-xs);
}

.rate-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.rate-card {
    background: var(--bg-main);
    border: 1.5px solid var(--border);
    border-radius: 16px;
    padding: 18px;
    transition: all .2s;
}

.rate-card.current {
    border-color: var(--brand-primary);
    background: var(--brand-primary-soft);
    box-shadow: var(--glow-orange);
}

.rate-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.rate-tier-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.rate-tier-name {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--text-main);
}

.rate-tier-badge {
    font-size: 0.6rem;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 50px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.rate-tier-badge.free { background: var(--border); color: var(--text-muted); }
.rate-tier-badge.pro  { background: var(--brand-primary-soft); color: var(--brand-primary); border: 1px solid rgba(242,166,90,.25); }
.rate-tier-badge.ent  { background: rgba(59, 130, 246, .1); color: var(--sky-blue); border: 1px solid rgba(59,130,246,.2); }

.rate-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.74rem;
    margin-bottom: 6px;
    color: var(--text-muted);
}

.rate-row strong {
    color: var(--text-main);
    font-weight: 700;
}

.rate-bar-wrap {
    margin-top: 12px;
}

.rate-bar-track {
    height: 5px;
    background: var(--border);
    border-radius: 50px;
    overflow: hidden;
}

.rate-bar-fill {
    height: 100%;
    border-radius: 50px;
    background: var(--brand-primary);
    transition: width .5s ease;
}

.rate-bar-fill.safe  { background: var(--brand-teal); }
.rate-bar-fill.warn  { background: var(--warning); }
.rate-bar-fill.full  { background: var(--danger); }

.rate-usage-txt {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 5px;
}

.rate-unlimited-txt {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--brand-teal);
    margin-top: 10px;
}

.rate-current-lbl {
    font-size: 0.63rem;
    font-weight: 800;
    color: var(--brand-primary);
    margin-left: auto;
}


/* ── Modals (matching wallet.css pattern) ─────────────────── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(26, 26, 46, .6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1200;
    backdrop-filter: blur(6px);
}

.modal-backdrop.open {
    display: flex;
}

.modal-card {
    background: var(--white);
    width: 100%;
    max-width: 500px;
    max-height: 92vh;
    overflow-y: auto;
    border-radius: 24px;
    box-shadow: var(--shadow-xl);
    margin: 0 16px;
}

.modal-card .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border);
}

.modal-card .modal-header h3 {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0;
}

.close-btn {
    background: transparent;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
    transition: color .15s;
}

.close-btn:hover {
    color: var(--brand-primary);
}

.modal-body-inner {
    padding: 20px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

.form-input {
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    font-size: 0.875rem;
    color: var(--text-main);
    outline: none;
    transition: all .15s;
    background: var(--white);
}

.form-input:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(242, 166, 90, .12);
}

.form-select {
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    font-size: 0.875rem;
    color: var(--text-main);
    outline: none;
    background: var(--white);
    cursor: pointer;
    transition: border-color .15s;
}

.form-select:focus {
    border-color: var(--brand-primary);
}

/* Checkbox list — matching wallet pay-option feel */
.checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cb-item {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 11px 13px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all .15s;
}

.cb-item:hover {
    border-color: var(--brand-primary);
    background: var(--brand-primary-soft);
}

.cb-item input[type="checkbox"] {
    accent-color: var(--brand-primary);
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    margin-top: 2px;
}

.cb-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 2px;
}

.cb-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.modal-footer-btns {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 4px;
}


/* ── Toast ────────────────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 28px;
    right: 28px;
    background: var(--brand-secondary);
    color: var(--white);
    padding: 12px 18px;
    border-radius: 14px;
    font-size: 0.82rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 9px;
    box-shadow: var(--shadow-xl);
    transform: translateY(80px);
    opacity: 0;
    transition: transform .32s cubic-bezier(.22, 1, .36, 1), opacity .32s;
    z-index: 9999;
    pointer-events: none;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast i {
    font-size: 1.05rem;
    color: var(--brand-primary);
}


/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1100px) {
    .api-stats-row { grid-template-columns: 1fr 1fr; }
    .keys-grid { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
    .two-col-grid { grid-template-columns: 1fr; }
    .sdk-grid { grid-template-columns: repeat(2, 1fr); }
    .rate-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 840px) {
    .api-hero {
        flex-direction: column;
        padding: 24px 22px;
        border-radius: 16px;
    }

    .api-hero-stats {
        flex-direction: row;
        width: 100%;
        gap: 10px;
    }

    .hero-stat {
        flex: 1;
        min-width: 0;
    }

    .hero-stat-val { font-size: 1.25rem; }

    .api-hero-title { font-size: 1.65rem; }

    .api-stats-row { grid-template-columns: 1fr 1fr; gap: 12px; }

    .api-keys-section,
    .sdk-section,
    .rate-section {
        padding: 18px;
        border-radius: 16px;
    }
}

@media (max-width: 600px) {
    .api-stats-row { grid-template-columns: 1fr; }
    .sdk-grid { grid-template-columns: 1fr 1fr; }
    .rate-grid { grid-template-columns: 1fr; }

    .api-hero-pills { gap: 6px; }
    .api-pill { font-size: 0.7rem; padding: 5px 10px; }

    .kc-meta-row { gap: 8px; }

    .modal-card { border-radius: 16px; }
}

@media (max-width: 420px) {
    .api-hero-stats { flex-direction: column; }
    .hero-stat { text-align: left; }
    .sdk-grid { grid-template-columns: 1fr; }
}
