:root {
    --ink: #101828;
    --ink-soft: #354052;
    --muted: #788296;
    --paper: #f5f7fb;
    --surface: #ffffff;
    --line: #e3e8f0;
    --line-dark: #d4dce8;
    --navy: #111d31;
    --navy-2: #18253c;
    --mint: #68d9b7;
    --mint-dark: #1b9b7d;
    --gold: #e8b65a;
    --coral: #e98478;
    --blue: #68a8ef;
    --shadow: 0 16px 38px rgba(22, 38, 66, 0.08);
    --radius: 8px;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    line-height: 1.55;
    letter-spacing: 0;
}
button, input, textarea, select { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
.hidden { display: none !important; }

.topbar {
    height: 74px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 6vw;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 10;
}
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand strong { display: block; color: var(--ink); font-size: 15px; font-weight: 750; line-height: 1.1; }
.brand small { display: block; color: var(--muted); font-size: 10px; margin-top: 4px; letter-spacing: .08em; text-transform: uppercase; }
.brand-mark { width: 30px; height: 30px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 6px; background: var(--navy); border-radius: 7px; }
.brand-mark span { display: block; background: var(--mint); border-radius: 2px; }
.brand-mark span:nth-child(2) { background: var(--gold); }
.brand-mark span:nth-child(3) { background: var(--blue); }
.topnav { display: flex; align-items: center; gap: 28px; margin-left: auto; margin-right: 30px; }
.topnav a { color: var(--muted); font-size: 13px; padding: 26px 0 23px; border-bottom: 2px solid transparent; }
.topnav a:hover, .topnav a.active { color: var(--ink); border-bottom-color: var(--mint-dark); }
.top-status { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.status-dot { width: 7px; height: 7px; display: inline-block; background: var(--mint-dark); border-radius: 50%; box-shadow: 0 0 0 4px rgba(104, 217, 183, .16); }

.portal-main { max-width: 1240px; margin: 0 auto; padding: 74px 6vw 48px; }
.welcome-grid { display: grid; grid-template-columns: minmax(0, 1.14fr) minmax(360px, .86fr); gap: clamp(40px, 7vw, 110px); align-items: center; min-height: 485px; }
.section-kicker { margin: 0 0 12px; color: var(--mint-dark); font-size: 10px; font-weight: 800; line-height: 1.2; letter-spacing: .17em; }
.welcome-copy h1 { max-width: 620px; margin: 0; color: var(--navy); font-size: clamp(40px, 5.2vw, 68px); font-weight: 780; line-height: 1.05; letter-spacing: -.04em; }
.welcome-copy h1 em { color: var(--mint-dark); font-style: normal; }
.lede { max-width: 570px; margin: 26px 0 28px; color: var(--ink-soft); font-size: 16px; line-height: 1.8; }
.compat-row { display: flex; flex-wrap: wrap; gap: 10px; }
.protocol-mark { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; color: var(--ink-soft); background: #edf2f7; border: 1px solid var(--line); border-radius: 5px; font-size: 12px; }
.protocol-mark b { color: var(--navy); font-size: 15px; font-weight: 700; }
.model-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 34px; }
.mini-label { margin-right: 4px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .11em; }
.model-token { padding: 5px 8px; color: #516074; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.activation-card { padding: 30px 31px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.panel-heading > div { display: flex; align-items: center; gap: 11px; }
.panel-heading h2 { margin: 0; color: var(--navy); font-size: 19px; line-height: 1.2; }
.panel-heading.compact h2 { font-size: 17px; }
.step-number { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; color: var(--navy); background: var(--mint); border-radius: 5px; font-size: 10px; font-weight: 800; letter-spacing: .06em; }
.tiny-label { color: var(--muted); font-size: 10px; white-space: nowrap; }
.panel-copy { margin: 19px 0 23px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.stack-form { display: flex; flex-direction: column; gap: 9px; }
.stack-form label, .admin-form-grid label { color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.stack-form input, .admin-form-grid input, .channel-form input, .channel-form select {
    width: 100%;
    height: 43px;
    padding: 0 12px;
    color: var(--ink);
    background: #fbfcfe;
    border: 1px solid var(--line-dark);
    border-radius: 5px;
    outline: none;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.stack-form input:focus, .admin-form-grid input:focus, .channel-form input:focus, .channel-form select:focus { border-color: var(--mint-dark); background: #fff; box-shadow: 0 0 0 3px rgba(104, 217, 183, .16); }
.input-with-icon { position: relative; }
.input-with-icon > span { position: absolute; top: 10px; left: 13px; color: var(--muted); font-family: ui-monospace, monospace; font-size: 16px; z-index: 1; }
.input-with-icon input { padding-left: 36px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .07em; }
.button { min-height: 39px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 0 15px; border: 1px solid transparent; border-radius: 5px; font-size: 12px; font-weight: 750; transition: transform .16s ease, background .16s ease, border-color .16s ease, color .16s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: #0f2330; background: var(--mint); border-color: var(--mint); }
.button-primary:hover { background: #83e3c5; }
.button-wide { width: 100%; min-height: 47px; margin-top: 10px; }
.button-arrow { font-size: 17px; line-height: 1; }
.button-quiet { color: var(--ink-soft); background: #fff; border-color: var(--line-dark); }
.button-quiet:hover { color: var(--navy); border-color: #a9b6c9; background: #f8fafc; }
.button-danger { color: #a94f49; background: #fff6f4; border-color: #efc9c4; }
.button-danger:hover { color: #8f3e39; background: #fbe9e7; border-color: #dfaaa3; }
.danger-text { color: #bd6158; }
.form-message { min-height: 21px; margin: 3px 0 0; color: #bf5a4e; font-size: 12px; }
.form-message.success { color: var(--mint-dark); }
.secure-note { display: flex; gap: 8px; align-items: flex-start; margin-top: 23px; padding-top: 17px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.5; }
.lock-icon { color: var(--mint-dark); font-size: 13px; }

.console-section { margin-top: 54px; padding-top: 47px; border-top: 1px solid var(--line-dark); animation: reveal .35s ease both; scroll-margin-top: 92px; }
@keyframes reveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.section-heading-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.section-heading-row h2 { margin: 0; color: var(--navy); font-size: 28px; line-height: 1.15; letter-spacing: -.02em; }
.section-heading-row.small { margin-top: 48px; }
.section-heading-row.small h2 { font-size: 22px; }
.section-actions { display: flex; gap: 8px; }
.muted-note { color: var(--muted); font-size: 12px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.metric-card { min-height: 149px; padding: 21px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.metric-card strong { display: block; margin-top: 11px; color: var(--navy); font-size: 27px; font-weight: 760; letter-spacing: -.03em; }
.metric-label { color: var(--ink-soft); font-size: 12px; font-weight: 720; }
.metric-sub { display: block; min-height: 18px; margin-top: 4px; color: var(--muted); font-size: 11px; }
.metric-time { border-top: 3px solid var(--blue); }
.metric-quota { border-top: 3px solid var(--mint-dark); }
.progress-track { height: 4px; margin-top: 14px; overflow: hidden; background: #e8edf3; border-radius: 2px; }
.progress-track span { display: block; height: 100%; background: var(--mint-dark); border-radius: 2px; transition: width .3s ease; }
.metric-time .progress-track span { background: var(--blue); }
.usage-endpoint-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-top: 12px; }
.traffic-panel, .endpoint-panel { min-height: 244px; padding: 24px; }
.traffic-hero { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-top: 18px; }
.traffic-hero strong { color: var(--navy); font-size: 31px; font-weight: 780; letter-spacing: -.04em; }
.traffic-hero span { color: var(--muted); font-size: 11px; text-align: right; }
.traffic-progress-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; margin-top: 13px; }
.traffic-progress-line .progress-track { width: 100%; margin-top: 0; }
.traffic-progress-line .progress-track span { background: var(--coral); }
.traffic-progress-line > span { color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.traffic-breakdown { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 23px; }
.traffic-stat { min-width: 0; padding-top: 10px; border-top: 1px solid var(--line); }
.traffic-stat span { display: block; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.traffic-stat strong { display: block; margin-top: 6px; color: var(--ink-soft); font-size: 15px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.endpoint-list { margin-top: 4px; }
.endpoint-row { display: grid; grid-template-columns: 112px minmax(0, 1fr) 42px; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); }
.endpoint-row:first-child { border-top: 0; }
.endpoint-row strong { display: block; color: var(--ink-soft); font-size: 11px; }
.endpoint-row small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.endpoint-row code { min-width: 0; color: var(--navy); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; line-height: 1.45; overflow-wrap: anywhere; }
.endpoint-row .icon-button { width: 42px; height: 36px; border: 1px solid var(--line); border-radius: 4px; font-size: 16px; }
.key-and-route-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr); gap: 12px; margin-top: 12px; }
.key-panel, .route-panel { min-height: 211px; padding: 24px; }
.live-badge { display: inline-flex; align-items: center; gap: 6px; color: var(--mint-dark); font-size: 11px; font-weight: 700; }
.copy-field { display: flex; align-items: center; border: 1px solid var(--line-dark); border-radius: 5px; overflow: hidden; background: #fbfcfe; }
.copy-field input { min-width: 0; flex: 1; height: 42px; padding: 0 12px; color: var(--navy); background: transparent; border: 0; outline: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.icon-button { width: 43px; height: 42px; color: var(--ink-soft); background: transparent; border: 0; border-left: 1px solid var(--line); font-size: 18px; }
.icon-button:hover { color: var(--mint-dark); background: #f2fbf8; }
.key-meta { display: flex; justify-content: space-between; gap: 15px; margin-top: 12px; color: var(--muted); font-size: 11px; }
.route-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.route-row strong { display: block; color: var(--ink-soft); font-size: 12px; }
.route-row small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.route-swatch { width: 8px; height: 8px; border-radius: 50%; }
.route-swatch.fast { background: var(--mint-dark); box-shadow: 0 0 0 4px rgba(27, 155, 125, .13); }
.route-swatch.slow { background: var(--gold); box-shadow: 0 0 0 4px rgba(232, 182, 90, .15); }
.route-arrow { color: var(--muted); font-size: 17px; }
.route-footnote { margin: 14px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.route-selector { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin: 17px 0 8px; padding: 4px; background: #f1f5f8; border: 1px solid var(--line); border-radius: 6px; }
.route-option { min-width: 0; min-height: 35px; padding: 0 7px; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 4px; font-size: 10px; font-weight: 750; white-space: nowrap; }
.route-option:hover { color: var(--ink-soft); background: #fff; }
.route-option.active { color: var(--navy); background: #fff; border-color: var(--line-dark); box-shadow: 0 2px 5px rgba(22, 38, 66, .06); }
.route-option:disabled { cursor: wait; opacity: .6; }
.integration-section, .models-section { margin-top: 47px; }
.integration-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.integration-card { min-height: 187px; padding: 20px; background: var(--navy); border-radius: var(--radius); color: #f7fbff; }
.integration-title { display: flex; align-items: center; gap: 10px; }
.integration-title strong { display: block; font-size: 13px; }
.integration-title small { display: block; margin-top: 2px; color: #a8b7ca; font-size: 10px; }
.integration-icon { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; color: #0b1b25; font-size: 15px; font-weight: 800; }
.integration-icon.claude { background: var(--gold); }
.integration-icon.codex { background: var(--mint); }
.integration-icon.response { background: var(--blue); }
.snippet { display: flex; align-items: center; gap: 8px; min-height: 59px; margin-top: 18px; padding: 9px 10px; background: #0b1524; border: 1px solid #27364c; border-radius: 5px; }
.snippet code { min-width: 0; flex: 1; overflow-wrap: anywhere; color: #cbd8e8; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; line-height: 1.55; }
.snippet-copy { flex: 0 0 auto; padding: 4px 6px; color: var(--mint); background: transparent; border: 1px solid #3a5365; border-radius: 4px; font-size: 10px; }
.snippet-copy:hover { background: #17283c; }
.endpoint-line { display: flex; align-items: center; gap: 8px; margin-top: 14px; color: #8fa1b8; font-size: 10px; }
.endpoint-line span { color: var(--mint); font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.endpoint-line code { color: #dce7f3; font-family: ui-monospace, monospace; }
.model-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.model-row { display: flex; align-items: center; gap: 12px; padding: 17px 19px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.model-orb { width: 10px; height: 10px; flex: 0 0 auto; border-radius: 50%; }
.model-orb.flash { background: var(--mint-dark); }
.model-orb.pro { background: var(--coral); }
.model-row div { min-width: 0; flex: 1; }
.model-row strong { display: block; color: var(--ink); font-family: ui-monospace, monospace; font-size: 12px; overflow-wrap: anywhere; }
.model-row small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.model-state { color: var(--mint-dark); font-size: 11px; font-weight: 700; }
.site-footer { display: flex; justify-content: space-between; gap: 20px; max-width: 1240px; margin: 0 auto; padding: 28px 6vw 42px; color: var(--muted); border-top: 1px solid var(--line); font-size: 11px; }

/* Admin */
.admin-body { min-height: 100vh; color: var(--ink); background: #f1f4f8; }
.admin-login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px; background: var(--navy); }
.login-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 25px; color: #fff; font-size: 17px; }
.login-brand .brand-mark { background: #1c2d47; }
.login-card { width: min(410px, 100%); padding: 34px; box-shadow: 0 22px 60px rgba(0, 0, 0, .24); }
.login-card h1 { margin: 0; color: var(--navy); font-size: 31px; letter-spacing: -.03em; }
.login-card > p:not(.section-kicker):not(.login-hint) { margin: 9px 0 25px; color: var(--muted); }
.login-hint { margin: 20px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.back-link { margin-top: 18px; color: #aab9cc; font-size: 12px; }
.admin-app { min-height: 100vh; display: flex; }
.admin-sidebar { width: 232px; flex: 0 0 auto; display: flex; flex-direction: column; padding: 27px 16px 17px; color: #d9e3ee; background: var(--navy); }
.admin-brand { padding: 0 10px 33px; color: #fff; }
.admin-brand strong { color: #fff; }
.admin-brand small { color: #8092ab; }
.sidebar-section-label { padding: 0 12px 10px; color: #70839e; font-size: 9px; font-weight: 800; letter-spacing: .16em; }
.admin-nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 11px; padding: 11px 12px; color: #aab9cc; background: transparent; border: 0; border-radius: 5px; text-align: left; font-size: 12px; }
.nav-item:hover, .nav-item.active { color: #fff; background: #1b2a43; }
.nav-item.active { box-shadow: inset 3px 0 0 var(--mint); }
.nav-icon { width: 20px; color: var(--mint); font-size: 16px; text-align: center; }
.nav-caret { margin-left: auto; color: #607793; font-size: 18px; }
.sidebar-bottom { margin-top: auto; }
.sidebar-health { display: flex; align-items: center; gap: 9px; padding: 13px 10px; border-top: 1px solid #24344c; border-bottom: 1px solid #24344c; }
.sidebar-health strong { display: block; color: #cedae8; font-size: 11px; }
.sidebar-health small { display: block; margin-top: 2px; color: #71849d; font-size: 10px; }
.logout-button { width: 100%; margin-top: 12px; padding: 8px 10px; color: #889bb3; background: transparent; border: 0; text-align: left; font-size: 11px; }
.logout-button:hover { color: var(--coral); }
.admin-main { min-width: 0; flex: 1; padding: 34px clamp(22px, 4vw, 56px) 50px; }
.admin-topbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 31px; }
.admin-topbar h1 { margin: 0; color: var(--navy); font-size: 30px; letter-spacing: -.03em; }
.admin-top-actions { display: flex; align-items: center; gap: 13px; }
.admin-user { color: var(--muted); font-size: 11px; }
.admin-view { display: none; animation: reveal .25s ease both; }
.admin-view.active { display: block; }
.admin-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.admin-metric { min-height: 137px; padding: 20px; background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--blue); border-radius: var(--radius); }
.admin-metric.accent-mint { border-top-color: var(--mint-dark); }
.admin-metric.accent-gold { border-top-color: var(--gold); }
.admin-metric.accent-coral { border-top-color: var(--coral); }
.admin-metric span { color: var(--muted); font-size: 11px; }
.admin-metric strong { display: block; margin-top: 12px; color: var(--navy); font-size: 29px; line-height: 1; letter-spacing: -.04em; }
.admin-metric small { display: block; margin-top: 11px; color: var(--muted); font-size: 10px; }
.admin-two-col { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr); gap: 12px; margin-top: 12px; }
.admin-panel { margin-top: 12px; padding: 22px; }
.admin-two-col .admin-panel { margin-top: 0; }
.ranking-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; margin-top: 16px; }
.ranking-block { min-width: 0; }
.ranking-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line-dark); }
.ranking-heading strong { color: var(--navy); font-size: 12px; }
.ranking-heading small { color: var(--muted); font-size: 10px; }
.ranking-list { min-height: 80px; }
.ranking-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.ranking-row:last-child { border-bottom: 0; }
.ranking-number { color: var(--mint-dark); font-family: ui-monospace, monospace; font-size: 10px; font-weight: 800; }
.ranking-identity, .ranking-value { min-width: 0; }
.ranking-identity strong, .ranking-value strong { display: block; color: var(--ink-soft); font-size: 11px; }
.ranking-identity small, .ranking-value small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.ranking-value { text-align: right; }
.ranking-value strong { color: var(--navy); font-variant-numeric: tabular-nums; }
.text-link { padding: 0; color: var(--mint-dark); background: transparent; border: 0; font-size: 11px; font-weight: 700; }
.card-search { display: inline-flex; align-items: center; gap: 10px; }
.card-search input { width: 210px; padding: 5px 10px; font-size: 12px; color: var(--ink); background: transparent; border: 1px solid var(--line-dark); border-radius: 6px; outline: none; }
.card-search input:focus { border-color: var(--mint-dark); }
.card-search input::placeholder { color: var(--muted); }
.overview-channels { margin-top: 13px; }
.overview-channel { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 14px 0; border-top: 1px solid var(--line); }
.overview-channel:first-child { border-top: 0; }
.channel-dot { width: 8px; height: 8px; border-radius: 50%; }
.channel-dot.ok { background: var(--mint-dark); }
.channel-dot.off { background: var(--coral); }
.overview-channel strong { display: block; color: var(--ink-soft); font-size: 12px; }
.overview-channel small { display: block; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.channel-state { color: var(--muted); font-size: 10px; }
.charge-summary { margin-top: 19px; }
.charge-summary strong { display: block; color: var(--navy); font-size: 33px; letter-spacing: -.04em; }
.charge-summary span { color: var(--muted); font-size: 11px; }
.charge-bar { height: 7px; margin-top: 22px; overflow: hidden; background: #e8edf2; border-radius: 3px; }
.charge-bar span { display: block; width: 0; height: 100%; background: var(--gold); border-radius: 3px; }
.charge-meta { display: flex; justify-content: space-between; margin-top: 11px; color: var(--muted); font-size: 10px; }
.charge-meta b { color: var(--ink-soft); font-size: 11px; }
.panel-note { margin: 16px 0 0; padding-top: 13px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; line-height: 1.5; }
.table-wrap { width: 100%; overflow-x: auto; margin-top: 13px; }
.data-table { width: 100%; min-width: 690px; border-collapse: collapse; text-align: left; }
.data-table th { padding: 9px 10px; color: var(--muted); border-bottom: 1px solid var(--line-dark); font-size: 9px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 12px 10px; color: var(--ink-soft); border-bottom: 1px solid var(--line); font-size: 11px; white-space: nowrap; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table code { color: var(--navy); font-family: ui-monospace, monospace; font-size: 10px; }
.table-empty { padding: 32px 10px; color: var(--muted); text-align: center; font-size: 12px; }
.table-tag { display: inline-block; padding: 4px 6px; color: var(--mint-dark); background: #e9f8f3; border-radius: 3px; font-size: 10px; }
.table-tag.warn { color: #9a6b1d; background: #fbf2df; }
.table-tag.off { color: #b75d54; background: #fbe9e7; }
.view-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.view-intro h2 { margin: 0; color: var(--navy); font-size: 27px; letter-spacing: -.03em; }
.view-intro p:not(.section-kicker) { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.view-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.usage-actions { display: none; }
.cards-top { margin-top: 0; }
.admin-form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 12px; margin-top: 20px; }
.admin-form-grid input { margin-top: 6px; }
.admin-form-grid .button { grid-column: span 2; width: max-content; }
.model-choice { grid-column: span 2; display: flex; flex-wrap: wrap; gap: 9px 17px; margin: 0; padding: 11px 12px 12px; color: var(--ink-soft); border: 1px solid var(--line-dark); border-radius: 5px; }
.model-choice legend { padding: 0 5px; color: var(--muted); font-size: 10px; font-weight: 700; }
.model-choice label { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-soft); font-family: ui-monospace, monospace; font-size: 10px; font-weight: 500; }
.model-choice input { width: 14px; height: 14px; margin: 0; accent-color: var(--mint-dark); }
.generated-codes { margin-top: 18px; padding: 13px; background: #f2faf7; border: 1px solid #c8eee1; border-radius: 5px; }
.generated-codes strong { display: block; color: var(--mint-dark); font-size: 11px; }
.generated-code-line { display: flex; align-items: center; gap: 7px; margin-top: 8px; }
.generated-code-line code { flex: 1; color: var(--navy); font-family: ui-monospace, monospace; font-size: 11px; }
.generated-code-line button { padding: 3px 7px; color: var(--mint-dark); background: #fff; border: 1px solid #b6dfd3; border-radius: 3px; font-size: 10px; }
.policy-list { margin: 17px 0 0; padding: 0; list-style: none; }
.policy-list li { display: flex; gap: 11px; padding: 13px 0; border-top: 1px solid var(--line); }
.policy-list li:first-child { border-top: 0; }
.policy-list li > span { color: var(--mint-dark); font-family: ui-monospace, monospace; font-size: 10px; font-weight: 800; }
.policy-list strong { display: block; color: var(--ink-soft); font-size: 11px; }
.policy-list small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.channel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.channel-card { padding: 22px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.channel-card.primary { border-top: 3px solid var(--mint-dark); }
.channel-card.fallback { border-top: 3px solid var(--gold); }
.channel-card h3 { margin: 0; color: var(--navy); font-size: 17px; }
.channel-card .channel-description { margin: 7px 0 20px; color: var(--muted); font-size: 11px; }
.channel-form { display: flex; flex-direction: column; gap: 8px; }
.channel-form label { color: var(--ink-soft); font-size: 10px; font-weight: 700; }
.channel-form input { margin-top: 4px; }
.channel-actions { display: flex; gap: 8px; margin-top: 9px; }
.channel-actions .button { flex: 1; }
.checkbox-line { display: flex !important; align-items: center; gap: 7px; margin-top: 4px; color: var(--ink-soft); font-weight: 500 !important; }
.checkbox-line input { width: 14px; height: 14px; margin: 0; accent-color: var(--mint-dark); }
.pricing-panel { margin-top: 12px; }
.pricing-grid { display: grid; grid-template-columns: minmax(170px, .9fr) repeat(3, 1fr) auto; gap: 10px; align-items: end; padding: 13px 0; border-top: 1px solid var(--line); }
.pricing-grid:first-child { border-top: 0; }
.pricing-grid label { color: var(--muted); font-size: 10px; }
.pricing-grid input { width: 100%; height: 37px; margin-top: 5px; padding: 0 8px; border: 1px solid var(--line-dark); border-radius: 4px; outline: none; font-size: 11px; }
.pricing-grid input:focus { border-color: var(--mint-dark); }
.pricing-model { padding-bottom: 9px; color: var(--navy); font-family: ui-monospace, monospace; font-size: 11px; }

@media (max-width: 940px) {
    .topbar { padding: 0 25px; }
    .portal-main { padding: 55px 25px 42px; }
    .welcome-grid { grid-template-columns: 1fr; gap: 38px; min-height: auto; }
    .welcome-copy h1 { font-size: clamp(42px, 9vw, 64px); }
    .activation-card { max-width: 590px; }
    .metric-grid, .admin-metrics { grid-template-columns: repeat(2, 1fr); }
    .admin-sidebar { width: 205px; }
    .admin-main { padding: 28px 25px 42px; }
}
@media (max-width: 700px) {
    .topbar { height: 65px; padding: 0 16px; }
    .topnav { gap: 14px; margin-right: 14px; }
    .topnav a { padding: 22px 0 19px; font-size: 11px; }
    .top-status { display: none; }
    .portal-main { padding: 39px 16px 34px; }
    .welcome-copy h1 { font-size: 42px; }
    .lede { margin-top: 20px; font-size: 14px; }
    .model-line { margin-top: 24px; }
    .activation-card { padding: 23px 20px; }
    .console-section { margin-top: 40px; padding-top: 35px; }
    .section-heading-row { align-items: flex-start; flex-direction: column; gap: 13px; }
    .section-heading-row.small { margin-top: 38px; }
    .metric-grid, .usage-endpoint-grid, .key-and-route-grid, .integration-grid, .model-grid, .admin-two-col, .channel-grid { grid-template-columns: 1fr; }
    .metric-card { min-height: 132px; }
    .traffic-panel, .endpoint-panel, .key-panel, .route-panel { min-height: auto; padding: 20px; }
    .traffic-breakdown { grid-template-columns: repeat(2, 1fr); }
    .site-footer { flex-direction: column; padding: 24px 16px 34px; }
    .admin-login { padding: 20px; }
    .login-card { padding: 25px 20px; }
    .admin-app { display: block; }
    .admin-sidebar { width: 100%; min-height: auto; padding: 17px 14px 12px; }
    .admin-brand { padding: 0 5px 17px; }
    .sidebar-section-label, .sidebar-bottom { display: none; }
    .admin-nav { flex-direction: row; overflow-x: auto; }
    .nav-item { width: auto; flex: 1 0 auto; justify-content: center; padding: 9px 11px; white-space: nowrap; }
    .nav-item.active { box-shadow: inset 0 -3px 0 var(--mint); }
    .nav-caret { display: none; }
    .admin-main { padding: 23px 16px 34px; }
    .admin-topbar { align-items: flex-start; flex-direction: column; margin-bottom: 22px; }
    .admin-top-actions { width: 100%; justify-content: space-between; }
    .admin-metrics { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .admin-metric { min-height: 115px; padding: 14px; }
    .admin-metric strong { margin-top: 8px; font-size: 24px; }
    .view-intro { align-items: flex-start; flex-direction: column; }
    .view-actions { width: 100%; justify-content: space-between; }
    .ranking-grid { grid-template-columns: 1fr; gap: 18px; }
    .ranking-heading { align-items: flex-start; flex-direction: column; gap: 3px; }
    .usage-actions { justify-content: stretch; }
    .usage-actions .button { width: 100%; }
    .admin-form-grid { grid-template-columns: 1fr; }
    .admin-form-grid .button { grid-column: span 1; width: 100%; }
    .model-choice { grid-column: span 1; }
    .channel-card { padding: 18px; }
    .pricing-grid { grid-template-columns: 1fr 1fr; }
    .pricing-grid .pricing-model { grid-column: span 2; }
    .pricing-grid .button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
