/* api-access.css — My Profile → API Access (.apik-*)
   Five numbered sections on one page: Your API key · What the key can reach ·
   Connecting · Active sessions · Usage. Past keys live in a popup. One active
   key per person. Brand: green #1E6332 / #214A3E, beige #F4F0E9, caramel #C19A6B. */

.apik-page { display: grid; gap: 18px; }

/* ── Section shell ─────────────────────────────────────────────────────── */
.apik-section { background: #fff; border: 1px solid #e8e3da; border-radius: 16px; padding: 18px 20px 20px; box-shadow: 0 1px 3px rgba(0,0,0,.03); }
.apik-sec-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid #efeae2; }
.apik-sec-titles { min-width: 0; }
.apik-sec-title { display: flex; align-items: center; gap: 9px; margin: 0 0 4px; font-size: 16px; font-weight: 700; color: #214A3E; }
.apik-sec-title > i { color: #C19A6B; font-size: 14px; }
.apik-sec-n { width: 24px; height: 24px; border-radius: 50%; background: #1E6332; color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.apik-sec-sub { margin: 0; font-size: 13px; line-height: 1.55; color: #6b7280; max-width: 860px; }
.apik-sec-sub code, .apik-connect-hint code, .apik-reveal-foot code, .apik-ov-sub code { background: #F4F0E9; color: #214A3E; padding: 1px 5px; border-radius: 5px; font-size: 11.5px; }
.apik-sec-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.apik-ghost-btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid #e8e3da; background: #fff; color: #475453; font: inherit; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 9px; cursor: pointer; }
.apik-ghost-btn:hover { border-color: #C19A6B; color: #214A3E; background: #fbfaf7; }
.apik-ghost-btn i { color: #C19A6B; }
.apik-count { font-size: 11px; font-weight: 700; background: #F4F0E9; color: #475453; padding: 1px 7px; border-radius: 999px; }
.apik-count-label { font-size: 13px; color: #6b7280; }
.apik-muted { font-size: 12.5px; color: #9ca3af; }
.apik-loading, .apik-empty { padding: 18px; color: #6b7280; font-size: 13.5px; text-align: center; }
.apik-empty { display: flex; gap: 12px; align-items: center; justify-content: center; text-align: left; border: 1px dashed #d6cfc2; border-radius: 12px; background: #fbfaf7; line-height: 1.5; }
.apik-empty > i { font-size: 22px; color: #C19A6B; }
.apik-empty-sm { padding: 12px 14px; font-size: 13px; }
.apik-empty-sm > i { font-size: 18px; }

/* ── 1 · The key ───────────────────────────────────────────────────────── */
.apik-key { display: flex; gap: 16px; align-items: flex-start; padding: 16px 18px; border: 1px solid #cfe3d6; border-radius: 14px; background: linear-gradient(180deg, #f6faf7 0%, #fff 60%); }
.apik-key-icon { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 12px; background: #1E6332; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 18px; box-shadow: 0 4px 10px rgba(30,99,50,.25); }
.apik-key-main { flex: 1; min-width: 0; }
.apik-key-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.apik-name { font-weight: 700; font-size: 16px; color: #212529; }
.apik-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; letter-spacing: .02em; }
.apik-pill .fa-circle { font-size: 6px; }
.apik-pill-active { background: #e7f0ea; color: #1E6332; }
.apik-pill-expired { background: #f6efe4; color: #8a6536; }
.apik-pill-revoked { background: #eceeef; color: #475453; }
.apik-prefix { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.apik-prefix code { font-size: 13px; color: #214A3E; background: #F4F0E9; padding: 2px 8px; border-radius: 6px; }
.apik-prefix-hint { font-size: 11.5px; color: #9ca3af; }
.apik-facts { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.apik-fact { display: inline-flex; align-items: baseline; gap: 6px; font-size: 12.5px; }
.apik-fact i { color: #C19A6B; font-size: 11px; position: relative; top: -1px; }
.apik-fact-l { color: #9ca3af; }
.apik-fact-v { color: #374151; font-weight: 600; }
.apik-key-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; flex-shrink: 0; }
.apik-confirm-text { font-size: 12.5px; color: #b00000; max-width: 260px; text-align: right; line-height: 1.4; }
.apik-empty-key { display: flex; align-items: center; gap: 16px; padding: 20px 22px; border: 1px dashed #cfe3d6; border-radius: 14px; background: #f6faf7; }
.apik-empty-key-icon { width: 46px; height: 46px; flex: 0 0 46px; border-radius: 12px; background: #e7f0ea; color: #1E6332; display: flex; align-items: center; justify-content: center; font-size: 19px; }
.apik-empty-key-text { flex: 1; min-width: 0; display: grid; gap: 2px; font-size: 13.5px; color: #4b5563; line-height: 1.5; }
.apik-empty-key-text strong { color: #212529; font-size: 15px; }

/* Create / replace panel */
.apik-create { margin: 0 0 14px; }
.apik-create-form, .apik-reveal { border: 1px solid #e8e3da; border-radius: 14px; padding: 16px 18px; background: #fbfaf7; }
.apik-create-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; color: #214A3E; margin-bottom: 12px; }
.apik-create-title i { color: #C19A6B; }
.apik-create-warn { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; padding: 10px 14px; background: #fbf6ee; border: 1px solid #ead9c0; border-left: 4px solid #C19A6B; border-radius: 10px; font-size: 13px; line-height: 1.5; color: #4b3a26; }
.apik-create-warn i { color: #C19A6B; margin-top: 3px; }
.apik-create-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr); gap: 14px; }
.apik-create-row label { display: block; font-size: 12.5px; font-weight: 700; color: #374151; margin-bottom: 5px; }
.apik-create-row small { display: block; margin-top: 5px; font-size: 12px; color: #9ca3af; }
.apik-req { color: #b00000; }
.apik-notes { display: grid; gap: 6px; margin: 14px 0; padding: 12px 14px; background: #fff; border: 1px solid #e8e3da; border-radius: 12px; font-size: 12.5px; color: #4b5563; }
.apik-notes > div { display: flex; gap: 9px; align-items: flex-start; line-height: 1.45; }
.apik-notes i { color: #1E6332; margin-top: 2px; width: 14px; text-align: center; flex-shrink: 0; }
.apik-create-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.apik-reveal { background: #f3f8f4; border-color: #cfe3d6; }
.apik-reveal-head { font-size: 15px; font-weight: 700; color: #1E6332; margin-bottom: 10px; }
.apik-reveal-head i { margin-right: 6px; }
.apik-reveal-key { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.apik-reveal-key code { flex: 1; min-width: 240px; font-size: 14px; padding: 10px 12px; background: #fff; border: 1px solid #cfe3d6; border-radius: 10px; color: #214A3E; word-break: break-all; }
.apik-reveal-warn { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; background: #fbf6ee; border: 1px solid #ead9c0; border-radius: 10px; font-size: 12.5px; color: #4b3a26; line-height: 1.5; margin-bottom: 12px; }
.apik-reveal-warn i { color: #C19A6B; margin-top: 2px; }
.apik-reveal-next-title { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #6b7280; margin-bottom: 6px; }
.apik-code { margin: 0 0 8px; padding: 12px 14px; background: #182620; color: #e7efe9; border-radius: 10px; font-size: 12.5px; line-height: 1.55; overflow-x: auto; white-space: pre; font-family: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace; }
.apik-code-sm { font-size: 11.5px; padding: 10px 12px; white-space: pre-wrap; word-break: break-all; }
.apik-reveal-foot { font-size: 12.5px; color: #6b7280; line-height: 1.5; margin-bottom: 12px; }
.apik-reveal-foot a { color: #1E6332; font-weight: 600; }

/* Past keys popup */
.apik-modal { position: fixed; inset: 0; z-index: 10120; display: none; }
.apik-modal.open { display: block; }
.apik-modal-backdrop { position: absolute; inset: 0; background: rgba(20, 30, 26, .55); }
.apik-modal-card { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(820px, 94vw); max-height: 86vh; display: flex; flex-direction: column; background: #fff; border-radius: 16px; box-shadow: 0 24px 60px rgba(0,0,0,.28); overflow: hidden; }
.apik-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 16px 20px; background: linear-gradient(135deg, #1E6332 0%, #214A3E 100%); color: #fff; }
.apik-modal-title { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.apik-modal-title i { color: #C19A6B; }
.apik-modal-sub { font-size: 12.5px; opacity: .85; margin-top: 3px; line-height: 1.45; }
.apik-modal-close { border: 0; background: rgba(255,255,255,.14); color: #fff; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 14px; flex-shrink: 0; }
.apik-modal-close:hover { background: rgba(255,255,255,.26); }
.apik-modal-body { padding: 14px 20px; overflow: auto; }
.apik-modal-foot { padding: 12px 20px; border-top: 1px solid #efeae2; display: flex; justify-content: flex-end; }
.apik-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.apik-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #6b7280; padding: 8px 10px; background: #F4F0E9; }
.apik-table td { padding: 10px; border-top: 1px solid #efeae2; vertical-align: top; color: #374151; }
.apik-table td code { font-size: 12px; color: #214A3E; background: #F4F0E9; padding: 1px 6px; border-radius: 5px; }
.apik-tbl-name { font-weight: 700; color: #212529; margin-bottom: 3px; }

/* ── 2 · What the key can reach ────────────────────────────────────────── */
.apik-ov-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.apik-ov-tile { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid #e8e3da; border-radius: 12px; background: #fbfaf7; min-width: 0; }
.apik-ov-tile > div:last-child { min-width: 0; }
.apik-ov-tile-icon { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 10px; background: #e7f0ea; color: #1E6332; display: flex; align-items: center; justify-content: center; font-size: 15px; }
.apik-ov-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #6b7280; margin-bottom: 4px; }
.apik-ov-value { font-size: 18px; font-weight: 700; color: #212529; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; }
.apik-ov-sub { font-size: 12.5px; color: #6b7280; margin-top: 4px; line-height: 1.5; }
.apik-ov-role { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: #e7f0ea; color: #1E6332; margin-right: 4px; }
.apik-ov-mods { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 4px; }
.apik-mod { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; border: 1px solid #e8e3da; background: #fff; color: #475453; }
.apik-mod.on { color: #1E6332; background: #e7f0ea; border-color: #cfe3d6; }
.apik-mod.off { color: #8a6536; background: #f6efe4; border-color: #ead9c0; }

/* ── 3 · Connecting ────────────────────────────────────────────────────── */
.apik-connect-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(240px, .9fr); gap: 12px; }
.apik-connect-card { border: 1px solid #e8e3da; border-radius: 12px; padding: 14px 16px; background: #fbfaf7; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.apik-connect-card .apik-ov-label { margin-bottom: 0; }
.apik-connect-card .apik-code { margin: 0; }
.apik-connect-hint { font-size: 12px; color: #9ca3af; line-height: 1.5; margin-top: auto; }
.apik-baseurl { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #fff; border: 1px solid #e8e3da; border-radius: 10px; }
.apik-baseurl code { font-size: 13px; color: #1E6332; background: transparent; word-break: break-all; }
.apik-copy { border: 0; background: transparent; color: #6b7280; cursor: pointer; padding: 2px 5px; border-radius: 6px; flex-shrink: 0; }
.apik-copy:hover { color: #1E6332; background: #F4F0E9; }
.apik-ov-status { background: linear-gradient(135deg, #1E6332 0%, #214A3E 100%); border-color: transparent; color: #fff; align-items: flex-start; }
.apik-ov-status .apik-ov-label { color: rgba(255,255,255,.75); }
.apik-live { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; padding: 6px 12px 6px 10px; border-radius: 999px; background: rgba(0,0,0,.22); }
.apik-live-dot { width: 9px; height: 9px; border-radius: 50%; background: #9ca3af; box-shadow: 0 0 0 3px rgba(255,255,255,.14); }
.apik-live.is-ok .apik-live-dot { background: #4ade80; box-shadow: 0 0 0 3px rgba(74,222,128,.28); }
.apik-live.is-down .apik-live-dot { background: #f87171; box-shadow: 0 0 0 3px rgba(248,113,113,.28); }
.apik-live.is-checking .apik-live-dot { animation: apikPulse 1.2s ease-in-out infinite; }
@keyframes apikPulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.apik-ov-facts { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: rgba(255,255,255,.82); }
.apik-ov-facts b { color: #fff; font-size: 13px; }
.apik-ov-status .btn-outline-secondary { color: #fff; border-color: rgba(255,255,255,.35); background: transparent; margin-top: auto; }
.apik-ov-status .btn-outline-secondary:hover { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.6); }
.apik-ov-note { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; padding: 10px 14px; background: #fbf6ee; border: 1px solid #ead9c0; border-left: 4px solid #C19A6B; border-radius: 10px; font-size: 12.5px; line-height: 1.55; color: #4b3a26; }
.apik-ov-note > i { color: #C19A6B; margin-top: 3px; }
.apik-ov-note code { background: #fff; padding: 1px 6px; border-radius: 5px; font-size: 11.5px; color: #214A3E; word-break: break-all; }

/* ── 4 · Sessions ──────────────────────────────────────────────────────── */
.apik-session-list { display: grid; gap: 10px; }
.apik-session { display: flex; gap: 14px; align-items: center; padding: 12px 14px; border: 1px solid #e8e3da; border-radius: 12px; background: #fbfaf7; }
.apik-session-icon { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 10px; background: #e7f0ea; color: #1E6332; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.apik-session-main { flex: 1; min-width: 0; }
.apik-session-key { font-weight: 700; font-size: 14px; color: #212529; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.apik-ua { font-size: 11px; font-weight: 600; color: #475453; background: #F4F0E9; padding: 1px 8px; border-radius: 999px; }

/* ── 5 · Usage ─────────────────────────────────────────────────────────── */
.apik-seg { display: inline-flex; gap: 2px; background: #F4F0E9; padding: 3px; border-radius: 9px; }
.apik-seg-btn { border: 0; background: transparent; font: inherit; font-size: 12.5px; font-weight: 600; padding: 5px 12px; border-radius: 7px; cursor: pointer; color: #475453; }
.apik-seg-btn.active { background: #fff; color: #1E6332; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.apik-usage.is-loading { opacity: .55; pointer-events: none; }
.apik-usage-empty { display: flex; align-items: center; gap: 16px; padding: 20px 22px; border: 1px dashed #d6cfc2; border-radius: 14px; background: #fbfaf7; }
.apik-usage-empty-icon { width: 46px; height: 46px; flex: 0 0 46px; border-radius: 12px; background: #F4F0E9; color: #C19A6B; display: flex; align-items: center; justify-content: center; font-size: 19px; }
.apik-usage-empty > div:last-child { display: grid; gap: 2px; font-size: 13.5px; color: #4b5563; line-height: 1.5; }
.apik-usage-empty strong { color: #212529; font-size: 15px; }
.apik-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.apik-kpi { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid #e8e3da; border-radius: 12px; background: #fbfaf7; min-width: 0; }
.apik-kpi-i { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 10px; background: #e7f0ea; color: #1E6332; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.apik-kpi-v { font-size: 22px; font-weight: 700; color: #214A3E; line-height: 1.1; font-variant-numeric: tabular-nums; }
.apik-kpi-v-sm { font-size: 16px; }
.apik-kpi-of { font-size: 13px; font-weight: 600; color: #9ca3af; margin-left: 4px; }
.apik-kpi-l { font-size: 12px; color: #6b7280; margin-top: 2px; }
.apik-kpi-note { display: block; font-size: 11px; color: #9ca3af; }
.apik-kpi-good .apik-kpi-i { background: #e7f0ea; color: #1E6332; }
.apik-kpi-ok .apik-kpi-i { background: #f6efe4; color: #8a6536; }
.apik-kpi-bad .apik-kpi-i, .apik-kpi-warn .apik-kpi-i { background: #fbe9e9; color: #b00000; }
.apik-usage-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.apik-usage-card { border: 1px solid #e8e3da; border-radius: 12px; padding: 14px 16px; background: #fff; min-width: 0; }
.apik-usage-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 700; color: #214A3E; margin-bottom: 10px; }
.apik-usage-card-head-2 { margin-top: 14px; padding-top: 12px; border-top: 1px solid #efeae2; }
.apik-legend { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 500; color: #6b7280; }
.apik-lg { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.apik-lg-ok { background: #1E6332; }
.apik-lg-err { background: #db0000; }
.apik-bars { display: flex; align-items: flex-end; gap: 3px; height: 150px; padding: 6px 4px 0; border-bottom: 1px solid #efeae2; }
.apik-bar { flex: 1; min-width: 4px; height: 100%; display: flex; align-items: flex-end; position: relative; }
.apik-bar-fill { width: 100%; background: #1E6332; border-radius: 3px 3px 0 0; display: flex; flex-direction: column; justify-content: flex-start; overflow: hidden; transition: filter .12s; }
.apik-bar-err { width: 100%; background: #db0000; }
.apik-bar:hover .apik-bar-fill { filter: brightness(1.15); }
.apik-bar-tip { display: none; position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: #182620; color: #e7efe9; font-size: 11px; line-height: 1.4; padding: 5px 8px; border-radius: 7px; white-space: nowrap; z-index: 3; pointer-events: none; }
.apik-bar-tip em { color: #fca5a5; font-style: normal; }
.apik-bar:hover .apik-bar-tip { display: block; }
.apik-bars-axis { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11px; color: #9ca3af; }
.apik-bars-axis span { flex: 1; text-align: center; white-space: nowrap; }
.apik-bars-axis span:first-child { text-align: left; }
.apik-bars-axis span:last-child { text-align: right; }
.apik-routes { display: grid; gap: 8px; }
.apik-route-line { display: flex; align-items: center; gap: 8px; font-size: 12.5px; min-width: 0; }
.apik-route-line code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #374151; background: transparent; padding: 0; font-size: 12px; }
.apik-route-n { flex-shrink: 0; font-weight: 700; color: #214A3E; font-variant-numeric: tabular-nums; }
.apik-route-n em { font-style: normal; font-weight: 600; color: #b00000; font-size: 11px; margin-left: 2px; }
.apik-route-bar { height: 5px; background: #F4F0E9; border-radius: 999px; margin-top: 4px; overflow: hidden; }
.apik-route-fill { height: 100%; background: linear-gradient(90deg, #2F8542, #1E6332); border-radius: 999px; }
.apik-method { display: inline-block; min-width: 46px; text-align: center; font-size: 10px; font-weight: 800; letter-spacing: .05em; padding: 2px 6px; border-radius: 6px; flex-shrink: 0; }
.apik-method-get { background: #e7f0ea; color: #1E6332; }
.apik-method-post { background: #e0ecff; color: #1d4ed8; }
.apik-method-put, .apik-method-patch { background: #f6efe4; color: #8a6536; }
.apik-method-delete { background: #fbe9e9; color: #b00000; }
.apik-keys-usage { display: grid; gap: 8px; min-width: 0; }
.apik-key-usage { display: flex; gap: 10px; align-items: center; min-width: 0; }
.apik-key-usage-icon { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 8px; background: #F4F0E9; color: #C19A6B; display: flex; align-items: center; justify-content: center; font-size: 12px; }
.apik-key-usage-main { flex: 1 1 auto; min-width: 0; }
.apik-key-usage-name { font-size: 13px; font-weight: 700; color: #212529; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.apik-key-usage-name code { font-weight: 500; font-size: 11.5px; color: #6b7280; background: transparent; padding: 0; }
.apik-key-usage-sub { font-size: 12px; color: #6b7280; }
.apik-errs { display: grid; gap: 5px; }
.apik-err-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.apik-err-row code { color: #8a6536; background: #f6efe4; padding: 1px 7px; border-radius: 5px; font-size: 11.5px; }
.apik-err-row span { font-weight: 700; color: #374151; font-variant-numeric: tabular-nums; }

/* ── Dark theme ────────────────────────────────────────────────────────── */
body.dark-theme .apik-section, body.dark-theme .apik-usage-card { background: #1e293b; border-color: #334155; }
body.dark-theme .apik-sec-head { border-color: #334155; }
body.dark-theme .apik-sec-title { color: #86efac; }
body.dark-theme .apik-sec-sub, body.dark-theme .apik-count-label, body.dark-theme .apik-kpi-l, body.dark-theme .apik-ov-sub, body.dark-theme .apik-fact-l, body.dark-theme .apik-connect-hint, body.dark-theme .apik-key-usage-sub, body.dark-theme .apik-reveal-foot { color: #94a3b8; }
body.dark-theme .apik-sec-sub code, body.dark-theme .apik-connect-hint code, body.dark-theme .apik-reveal-foot code, body.dark-theme .apik-ov-sub code, body.dark-theme .apik-prefix code, body.dark-theme .apik-table td code, body.dark-theme .apik-err-row code { background: #0f172a; color: #86efac; }
body.dark-theme .apik-ghost-btn, body.dark-theme .apik-seg-btn.active, body.dark-theme .apik-baseurl, body.dark-theme .apik-notes, body.dark-theme .apik-mod { background: #0f172a; border-color: #334155; color: #cbd5e1; }
body.dark-theme .apik-count, body.dark-theme .apik-seg, body.dark-theme .apik-table th, body.dark-theme .apik-key-usage-icon, body.dark-theme .apik-route-bar { background: #0f172a; color: #94a3b8; }
body.dark-theme .apik-key, body.dark-theme .apik-empty-key, body.dark-theme .apik-empty, body.dark-theme .apik-usage-empty, body.dark-theme .apik-ov-tile, body.dark-theme .apik-connect-card, body.dark-theme .apik-session, body.dark-theme .apik-kpi, body.dark-theme .apik-create-form, body.dark-theme .apik-reveal { background: #0f172a; border-color: #334155; }
body.dark-theme .apik-name, body.dark-theme .apik-ov-value, body.dark-theme .apik-session-key, body.dark-theme .apik-tbl-name, body.dark-theme .apik-key-usage-name, body.dark-theme .apik-empty-key-text strong, body.dark-theme .apik-usage-empty strong { color: #e2e8f0; }
body.dark-theme .apik-fact-v, body.dark-theme .apik-table td, body.dark-theme .apik-route-line code, body.dark-theme .apik-err-row span, body.dark-theme .apik-empty-key-text, body.dark-theme .apik-usage-empty > div:last-child, body.dark-theme .apik-notes, body.dark-theme .apik-create-row label { color: #cbd5e1; }
body.dark-theme .apik-kpi-v, body.dark-theme .apik-route-n, body.dark-theme .apik-usage-card-head, body.dark-theme .apik-create-title, body.dark-theme .apik-baseurl code { color: #86efac; }
body.dark-theme .apik-mod.on, body.dark-theme .apik-ov-role, body.dark-theme .apik-pill-active, body.dark-theme .apik-kpi-i, body.dark-theme .apik-ov-tile-icon, body.dark-theme .apik-session-icon, body.dark-theme .apik-empty-key-icon { background: #163124; color: #86efac; border-color: #1f4d33; }
body.dark-theme .apik-mod.off { background: #3a2c17; color: #f5c78a; border-color: #5a4322; }
body.dark-theme .apik-ov-note, body.dark-theme .apik-create-warn, body.dark-theme .apik-reveal-warn { background: #2a2217; border-color: #4a3a22; color: #f1e6d3; }
body.dark-theme .apik-ov-note code { background: #0f172a; color: #86efac; }
body.dark-theme .apik-reveal-key code { background: #1e293b; border-color: #334155; color: #86efac; }
body.dark-theme .apik-modal-card { background: #1e293b; }
body.dark-theme .apik-modal-foot, body.dark-theme .apik-table td, body.dark-theme .apik-usage-card-head-2, body.dark-theme .apik-bars { border-color: #334155; }
body.dark-theme .apik-bar-tip { background: #0f172a; }

/* ── Mobile ────────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .apik-ov-grid, .apik-connect-grid, .apik-usage-grid { grid-template-columns: 1fr; }
    .apik-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
    .apik-section { padding: 14px; border-radius: 12px; }
    .apik-sec-head { flex-direction: column; }
    .apik-sec-actions { justify-content: flex-start; }
    .apik-key, .apik-empty-key, .apik-session { flex-direction: column; align-items: flex-start; }
    .apik-key-actions { justify-content: flex-start; }
    .apik-confirm-text { text-align: left; max-width: none; }
    .apik-create-grid { grid-template-columns: 1fr; }
    .apik-kpis { grid-template-columns: 1fr; }
    .apik-bars { height: 110px; gap: 2px; }
    .apik-bar-tip { display: none !important; }
    .apik-modal-card { width: 96vw; max-height: 92vh; }
}
