/* System Duo's Keys page: the head of the page, the key lists with each key's own usage charts on each system, and
   the confirmation dialog. From the Decision API Keys page; builds on style.css (tokens, nav, footer, buttons);
   everything here is kx-. */

.kx-page {
  --kx-amber: var(--ember-text);
  --kx-peach: var(--ember-text);
  --kx-coral: var(--ember);
  --kx-grad: linear-gradient(92deg, var(--ember-text) 0%, #f0a46c 45%, var(--ember) 80%, #e2657c 100%);
  --kx-warm-text: linear-gradient(100deg, #fbf1dc 0%, #f3ca86 48%, #e3a35a 100%);
  --kx-limit: var(--ember-text);
  --kx-server: var(--bad);
  --kx-client: rgba(22, 24, 29, .58);
  --kx-panel: linear-gradient(180deg, rgba(22, 24, 29, .046), rgba(22, 24, 29, .014));
  --kx-r: 24px;
}
.kx-page main { overflow-x: clip; }

/* ------------------------------------------------------------------ the sky over the head of the page */
/* No CSS masks on the moving layers (each frame would repaint them): the art is black around the black hole, and two
   still gradients on top fade it into the page, under the words and at the bottom. */
.kx-hero { position: relative; isolation: isolate; padding: clamp(60px, 11vh, 124px) 0 clamp(40px, 6vh, 64px); }
.kx-sky { position: absolute; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }
.kx-art { position: absolute; top: -18%; bottom: -10%; left: 16%; right: -14%; transform-origin: 70% 47%;
  animation: kx-drift 42s ease-in-out infinite alternate; will-change: transform; }
.kx-art picture, .kx-art img { position: absolute; inset: 0; width: 100%; height: 100%; }
.kx-motes { position: absolute; left: 0; top: 0; }
.kx-art img { object-fit: cover; object-position: 70% 47%; opacity: 0; transition: opacity 1.6s var(--ease); }
.kx-art.ready img { opacity: .82; }
.kx-glow { position: absolute; right: -6vw; top: -16vw; width: 60vw; height: 60vw; max-width: 1100px; max-height: 1100px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(243, 202, 134, .12), rgba(233, 122, 92, .05) 48%, rgba(226, 101, 124, 0) 72%);
  animation: kx-breathe 13s ease-in-out infinite alternate; will-change: opacity; }
/* The words stay readable over the art: black under the text column, fading out towards the black hole. */
.kx-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(90deg, rgba(0, 0, 0, .9) 0%, rgba(0, 0, 0, .62) 30%, rgba(0, 0, 0, 0) 58%),
              linear-gradient(0deg, #000 0%, rgba(0, 0, 0, 0) 32%), linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0) 14%); }
@keyframes kx-drift { from { transform: scale(1) translate3d(0, 0, 0); } to { transform: scale(1.07) translate3d(-1.4%, .8%, 0); } }
@keyframes kx-breathe { from { opacity: .5; } to { opacity: 1; } }
/* Hidden tab or the sky out of view: everything holds still (keys-sky.js toggles the class). */
.kx-still .kx-art, .kx-still .kx-glow { animation-play-state: paused; }

.kx-hero-in { position: relative; }
.kx-eyebrow { font: 500 12px/1.5 var(--mono); letter-spacing: .22em; text-transform: uppercase; color: var(--kx-amber); }
.kx-title { margin-top: 18px; max-width: 12.5em; font-size: clamp(44px, 6.6vw, 96px); line-height: .98; font-weight: 650; letter-spacing: -.046em; text-wrap: balance; }
.kx-warm { display: block; color: var(--ember-text); }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .kx-warm { background: var(--kx-warm-text); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; padding-bottom: .06em; }
}
@media (forced-colors: active) { .kx-warm { background: none; color: CanvasText; -webkit-text-fill-color: currentColor; } }
.kx-lede { margin-top: clamp(18px, 2.6vh, 26px); max-width: 34rem; font-size: clamp(18px, 1.5vw, 21px); line-height: 1.45; letter-spacing: -.016em; color: var(--ink-2); text-wrap: pretty; }
.kx-cta { margin-top: clamp(28px, 4.4vh, 40px); display: flex; flex-wrap: wrap; align-items: center; gap: 14px 16px; }
.kx-create { min-width: 13.5rem; }
.kx-ghost { display: inline-flex; align-items: center; height: 56px; padding: 0 26px; border-radius: 999px; border: 1px solid rgba(22, 24, 29, .2); background: rgba(22, 24, 29, .04);
  color: var(--fg); font-size: 16px; font-weight: 500; letter-spacing: -.01em; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); transition: background-color .2s, border-color .2s; }
.kx-ghost:hover { background: rgba(22, 24, 29, .1); border-color: rgba(22, 24, 29, .32); }
.kx-consent { margin-top: 14px; font-size: 12.5px; line-height: 1.45; color: var(--fg-3); }
.kx-consent a { color: var(--fg-2); }
.kx-nojs { margin-top: 14px; font-size: 14.5px; color: var(--fg-2); }
.kx-facts { margin-top: clamp(30px, 5vh, 52px); display: flex; flex-wrap: wrap; gap: 8px 0; font: 500 12px/1.6 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--fg-3); }
.kx-facts li { display: inline-block; white-space: nowrap; }
.kx-facts li + li::before { content: ""; display: inline-block; width: 4px; height: 4px; margin: 0 16px; border-radius: 50%; vertical-align: .2em; background: rgba(242, 180, 122, .55); }
.kx-facts b { font-weight: 500; color: var(--kx-peach); }
html.js .kx-facts:not(.ready) { visibility: hidden; }

/* The key creation's messages under the button: a dot, a title, a detail and maybe a button. */
.kx-alert { margin-top: 18px; max-width: 36rem; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 12px; padding: 14px 16px; border-radius: 16px;
  border: 1px solid var(--line); background: var(--surface); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); font-size: 14.5px; line-height: 1.45; animation: rise-s .45s var(--ease) both; }
.kx-alert::before { content: ""; grid-row: 1 / span 3; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--fg-3); }
.kx-alert.err::before { background: var(--bad); }
.kx-alert.limit { border-color: rgba(242, 180, 122, .35); }
.kx-alert.limit::before { background: var(--kx-amber); box-shadow: 0 0 0 4px rgba(242, 180, 122, .14); }
.kx-alert.work::before { background: var(--kx-amber); animation: breathe 1.2s ease-in-out infinite; }
.kx-alert b { font-weight: 600; }
.kx-alert span { color: var(--fg-2); }
.kx-alert .kx-text-btn { justify-self: start; margin-top: 6px; }

/* ------------------------------------------------------------------ shared pieces */
.kx-body { padding-bottom: clamp(56px, 9vh, 96px); }
.kx-label { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); }
.kx-h2 { font-size: clamp(28px, 2.6vw, 36px); line-height: 1.1; font-weight: 600; letter-spacing: -.03em; }
.kx-h3 { font-size: 20px; line-height: 1.25; font-weight: 600; letter-spacing: -.02em; }
.kx-sub { margin-top: 8px; max-width: 40rem; font-size: 15px; line-height: 1.5; color: var(--fg-3); }
.kx-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line);
  background: rgba(22, 24, 29, .06); color: var(--fg); font-size: 14px; font-weight: 500; white-space: nowrap; cursor: pointer; transition: background-color .2s, border-color .2s, color .2s, opacity .2s; }
.kx-btn:hover { background: rgba(22, 24, 29, .12); border-color: rgba(22, 24, 29, .22); }
.kx-btn.kx-danger { color: var(--bad); border-color: rgba(255, 105, 97, .42); background: rgba(255, 105, 97, .1); }
.kx-btn.kx-danger:hover { background: rgba(255, 105, 97, .2); border-color: rgba(255, 105, 97, .6); }
.kx-btn:disabled { opacity: .45; cursor: default; }
.kx-text-btn { padding: 0; border: 0; background: none; color: var(--fg); font-size: 14px; font-weight: 500; text-decoration: underline; text-underline-offset: .22em;
  text-decoration-color: rgba(22, 24, 29, .35); cursor: pointer; transition: text-decoration-color .2s; }
.kx-text-btn:hover { text-decoration-color: currentColor; }
.kx-text-btn:disabled { opacity: .45; cursor: default; }

/* ------------------------------------------------------------------ the new key, shown once */
.kx-new { position: relative; margin-top: clamp(8px, 2vh, 20px); padding: clamp(20px, 2.6vw, 30px); border-radius: var(--kx-r); outline: none; scroll-margin-top: 96px;
  border: 1px solid rgba(242, 180, 122, .32); background: radial-gradient(90% 120% at 0% 0%, rgba(240, 164, 108, .1), transparent 55%), var(--surface);
  box-shadow: 0 40px 120px -40px rgba(233, 122, 92, .35), inset 0 1px 0 rgba(22, 24, 29, .06); }
.kx-new.in { animation: rise .8s var(--ease) both; }
.kx-new-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.kx-new-head .kx-label { color: var(--kx-amber); }
.kx-secret { position: relative; margin-top: 12px; display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 18px; border-radius: 14px; background: var(--paper);
  border: 1px solid var(--line-2); overflow: hidden; }
.kx-secret-value { flex: 1; min-width: 0; font-size: clamp(13.5px, 1.3vw, 16px); line-height: 1.5; color: var(--ink); word-break: break-all; -webkit-user-select: all; user-select: all; }
.kx-secret::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(22, 24, 29, 0), rgba(255, 220, 180, .16), rgba(22, 24, 29, 0));
  transform: translateX(-100%); }
.kx-new.in .kx-secret::after { animation: glint 1.2s var(--ease-io) .35s both; }
.kx-warn { margin-top: 12px; font-size: 15px; }
.kx-warn::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 10px; border-radius: 50%; background: var(--warn); transform: translateY(-2px); }
.kx-call { margin-top: 22px; }
.kx-call-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.kx-fine { margin-top: 14px; font-size: 13px; color: var(--fg-3); }
.kx-fine a { color: var(--fg-2); }

/* ------------------------------------------------------------------ the key list */
.kx-keys { margin-top: clamp(36px, 6vh, 56px); }
.kx-sechead { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 24px; padding-bottom: 18px; border-bottom: 1px solid var(--line-2); }
.kx-count { flex: none; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); font: 500 11.5px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--fg-2); }
.kx-list { margin-top: 22px; display: grid; gap: 18px; }
.kx-list:empty { display: none; }
.kx-loading { margin-top: 22px; display: grid; gap: 18px; }
.kx-loading span { display: block; height: 92px; border-radius: var(--kx-r); border: 1px solid var(--line-2); background: rgba(22, 24, 29, .025); position: relative; overflow: hidden; }
.kx-loading span + span { height: 64px; opacity: .6; }
.kx-loading span::after, .kx-skel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(22, 24, 29, .05), transparent);
  transform: translateX(-100%); animation: kx-shimmer 1.6s var(--ease-io) infinite; }
@keyframes kx-shimmer { to { transform: translateX(100%); } }
.kx-loaded .kx-loading { display: none; }

.kx-empty { margin-top: 22px; display: grid; justify-items: center; gap: 10px; padding: clamp(36px, 6vh, 56px) 24px; border-radius: var(--kx-r); border: 1px dashed rgba(22, 24, 29, .16);
  background: radial-gradient(60% 90% at 50% 0%, rgba(240, 164, 108, .06), transparent 70%); text-align: center; animation: rise-s .5s var(--ease) both; }
.kx-empty-mark { width: 52px; height: 52px; color: var(--kx-peach); }
.kx-empty h3 { margin-top: 6px; font-size: 19px; letter-spacing: -.018em; }
.kx-empty p { max-width: 28rem; font-size: 15px; line-height: 1.5; color: var(--fg-2); }

/* One card per key. */
.kx-card { position: relative; border-radius: var(--kx-r); border: 1px solid var(--line-2); outline: none; scroll-margin-top: 96px;
  background: radial-gradient(110% 140% at 100% 0%, rgba(240, 164, 108, .06), transparent 46%), var(--kx-panel);
  box-shadow: inset 0 1px 0 rgba(22, 24, 29, .045), 0 40px 90px -50px rgba(0, 0, 0, .9); animation: rise .7s var(--ease) both; transition: border-color .3s, opacity .3s; }
.kx-card:focus-visible { border-color: rgba(22, 24, 29, .32); }
.kx-card.is-busy { opacity: .7; }
.kx-card.is-revoked, .kx-card.is-forgotten, .kx-card.is-invalid, .kx-card.is-unlisted { background: rgba(22, 24, 29, .018); }
.kx-head { display: flex; align-items: center; gap: 10px 16px; padding: clamp(16px, 2vw, 22px) clamp(18px, 2.4vw, 28px); }
.kx-toggle { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 16px; padding: 4px 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; border-radius: 10px; }
.kx-chev { flex: none; width: 28px; height: 28px; margin-left: -4px; display: grid; place-items: center; border-radius: 50%; color: var(--fg-3); transition: transform .45s var(--ease), background-color .2s, color .2s; }
.kx-chev svg { width: 12px; height: 12px; }
.kx-toggle:hover .kx-chev { background: rgba(22, 24, 29, .07); color: var(--fg); }
.kx-toggle[aria-expanded="true"] .kx-chev { transform: rotate(90deg); color: var(--fg); }
.kx-prefix { font: 500 18px/1.3 var(--mono); letter-spacing: -.01em; color: var(--fg); white-space: nowrap; }
.kx-pill { display: inline-flex; align-items: center; gap: 7px; height: 24px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); font-size: 12.5px; font-weight: 500; color: var(--fg-2); white-space: nowrap; }
.kx-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #636366; }
.kx-pill.active { color: #187944; border-color: rgba(48, 209, 88, .32); background: rgba(48, 209, 88, .07); }
.kx-pill.active::before { background: var(--ok); box-shadow: 0 0 0 3px rgba(48, 209, 88, .18); }
.kx-pill.disabled, .kx-pill.forgotten { color: #946217; border-color: rgba(242, 180, 122, .36); background: rgba(242, 180, 122, .07); }
.kx-pill.disabled::before, .kx-pill.forgotten::before { background: var(--kx-amber); }
.kx-pill.invalid { color: var(--bad); border-color: rgba(255, 105, 97, .36); }
.kx-pill.invalid::before { background: var(--bad); }
.kx-pill.source { border-style: dashed; color: var(--fg-3); }
.kx-pill.source::before { display: none; }
.kx-glance { display: flex; flex-wrap: wrap; gap: 4px 22px; font-size: 13.5px; color: var(--fg-3); font-variant-numeric: tabular-nums; }
.kx-glance b { font-weight: 500; color: var(--fg-2); }
.kx-tools { flex: none; display: flex; align-items: center; gap: 2px; margin-right: -8px; }
.kx-tool { height: 32px; padding: 0 12px; border: 0; border-radius: 999px; background: none; color: var(--fg-2); font-size: 13.5px; cursor: pointer; transition: background-color .2s, color .2s; }
.kx-tool:hover { background: rgba(22, 24, 29, .07); color: var(--fg); }
.kx-tool:disabled { opacity: .45; cursor: default; }
.kx-detail { padding: 0 clamp(18px, 2.4vw, 28px) clamp(18px, 2.4vw, 28px); }
.kx-meta { display: flex; flex-wrap: wrap; gap: 6px 28px; padding-bottom: 18px; font-size: 13.5px; }
.kx-meta div { display: flex; gap: 8px; align-items: baseline; }
.kx-meta dt { color: var(--fg-3); }
.kx-meta dd { color: var(--fg-2); }
.kx-meta code { font-size: 12.5px; color: var(--fg-2); }
.kx-msg { margin-top: 4px; margin-bottom: 18px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 12px; padding: 14px 16px; border-radius: 16px;
  border: 1px solid var(--line-2); background: rgba(22, 24, 29, .03); font-size: 14px; line-height: 1.5; animation: rise-s .4s var(--ease) both; }
.kx-msg::before { content: ""; grid-row: 1 / span 3; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--fg-3); }
.kx-msg > *, .kx-alert > * { grid-column: 2; }
.kx-msg .kx-text-btn { justify-self: start; margin-top: 6px; }
.kx-msg.ok::before { background: var(--ok); }
.kx-msg.err::before { background: var(--bad); }
.kx-msg.warn::before { background: var(--kx-amber); }
.kx-msg b { font-weight: 600; }
.kx-msg span { color: var(--fg-2); }

/* ------------------------------------------------------------------ usage */
.kx-usage { border-top: 1px solid var(--line-2); padding-top: 22px; }
.kx-usage-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.kx-usage-head .kx-label { color: var(--fg-2); }
.kx-updated { margin-left: auto; font-size: 12.5px; color: var(--fg-3); font-variant-numeric: tabular-nums; }
.kx-range button { min-width: 5.25rem; }
.kx-kpis { margin-top: 16px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-radius: 18px; border: 1px solid var(--line-2); background: var(--surface); overflow: hidden; }
.kx-kpis.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kx-kpi { position: relative; min-width: 0; padding: 18px 20px 18px; }
.kx-kpi + .kx-kpi { border-left: 1px solid var(--line-2); }
.kx-kpi dt { font-size: 12px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--fg-3); }
.kx-kpi dd { margin-top: 10px; }
.kx-kpi-v { display: block; font-size: clamp(28px, 2.6vw, 38px); line-height: 1; font-weight: 600; letter-spacing: -.035em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kx-kpi-v small { margin-left: 4px; font-size: .46em; font-weight: 500; letter-spacing: 0; color: var(--fg-3); }
.kx-kpi-sub { display: block; margin-top: 10px; font-size: 13px; line-height: 1.4; color: var(--fg-3); }
.kx-kpi .up { color: #187944; }
.kx-kpi .down { color: var(--fg-2); }
.kx-kpi-quota dd { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; align-items: center; }
.kx-kpi-quota .kx-kpi-sub { grid-column: 1 / -1; }
.kx-ring { width: 40px; height: 40px; transform: rotate(-90deg); }
.kx-ring circle { fill: none; stroke-width: 4; }
.kx-ring .track { stroke: rgba(22, 24, 29, .1); }
.kx-ring .fill { stroke: url(#kx-g-ring); stroke-linecap: round; transition: stroke-dashoffset 1.2s var(--ease); }
.kx-skel { position: relative; overflow: hidden; display: block; border-radius: 8px; background: rgba(22, 24, 29, .05); }
.kx-kpi .kx-skel { height: 34px; width: 70%; }
.kx-kpi .kx-skel + .kx-skel { height: 12px; margin-top: 12px; width: 50%; }

/* The chart: today's hours, or the last 7 or 30 days. */
.kx-chart { margin-top: 18px; padding: 18px 20px 14px; border-radius: 18px; border: 1px solid var(--line-2); background: var(--surface); }
.kx-chart-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.kx-chart-title { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.kx-chart-title span { margin-left: 8px; font-size: 13px; font-weight: 400; color: var(--fg-3); }
.kx-seg { position: relative; display: inline-flex; padding: 3px; border-radius: 999px; border: 1px solid var(--line); background: rgba(22, 24, 29, .03); }
.kx-seg button { position: relative; z-index: 1; height: 30px; padding: 0 14px; border: 0; border-radius: 999px; background: none; color: var(--fg-2); font-size: 13px; font-weight: 500; cursor: pointer; transition: color .2s, background-color .25s; }
.kx-seg button[aria-pressed="true"] { color: #111; background: var(--fg); }
.kx-seg button:not([aria-pressed="true"]):hover { color: var(--fg); }
.kx-plot { position: relative; margin-top: 14px; height: 220px; outline: none; border-radius: 10px; touch-action: pan-y; }
.kx-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.kx-plot:focus-visible { outline: 2px solid var(--red-ring); outline-offset: 6px; }
.kx-grid line { stroke: rgba(22, 24, 29, .07); stroke-width: 1; shape-rendering: crispEdges; }
.kx-grid text, .kx-avg text { fill: var(--fg-3); font: 11px var(--mono); }
.kx-avg line { stroke: rgba(246, 209, 164, .5); stroke-width: 1; stroke-dasharray: 3 4; shape-rendering: crispEdges; }
.kx-avg text { fill: var(--kx-peach); }
.kx-avg rect { fill: var(--surface); stroke: rgba(246, 209, 164, .22); stroke-width: 1; }
.kx-bars rect { transform-box: fill-box; transform-origin: 50% 100%; }
.kx-bars g { transition: opacity .2s; }
.kx-bars .zero { fill: rgba(22, 24, 29, .1); }
.kx-bars .later { fill: rgba(22, 24, 29, .04); }
.kx-bars .rest { fill: rgba(22, 24, 29, .24); }
.kx-bars .now { filter: drop-shadow(0 0 10px rgba(240, 164, 108, .45)); }
.kx-plot.grow .kx-bars rect { animation: kx-grow .9s var(--ease) both; animation-delay: calc(var(--i, 0) * 16ms); }
@keyframes kx-grow { from { transform: scaleY(0); } }
.kx-plot.pointing .kx-bars g:not(.on) { opacity: .45; }
.kx-guide { stroke: rgba(22, 24, 29, .28); stroke-width: 1; shape-rendering: crispEdges; }
/* Under the bars only: the plot keeps 46 px on the left for its scale and 6 px on the right. */
.kx-axis { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; padding: 0 6px 0 46px; font: 11px var(--mono); color: var(--fg-3); }
.kx-axis.even { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0; text-align: center; white-space: nowrap; }
.kx-chart .kx-key { margin-top: 12px; }
.kx-key i.rest { background: rgba(22, 24, 29, .24); }
.kx-chart-note { margin-top: 10px; font-size: 12.5px; color: var(--fg-3); }
.kx-tip { position: absolute; left: 0; top: 0; z-index: 3; min-width: 11rem; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .55); font-size: 12.5px; line-height: 1.5; color: var(--fg-2); pointer-events: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
.kx-tip b { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 600; color: var(--fg); }
.kx-tip .v { color: var(--fg); }
.kx-chart-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px; text-align: center; color: var(--fg-2); font-size: 15px; }
.kx-chart-empty small { font-size: 13px; color: var(--fg-3); }

/* Panels: per model, errors, latency, quota. */
.kx-panels { margin-top: 18px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.kx-panel { min-width: 0; padding: 18px 20px; border-radius: 18px; border: 1px solid var(--line-2); background: var(--surface); }
.kx-panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.kx-panel-head h4 { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.kx-panel-head span { font-size: 12.5px; color: var(--fg-3); text-align: right; }
.kx-rows { display: grid; gap: 12px; }
.kx-row { display: grid; grid-template-columns: minmax(0, 6.4rem) minmax(0, 1fr) auto; align-items: center; gap: 12px; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.kx-row .n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg); }
.kx-row .n small { margin-left: 5px; font-size: 11.5px; color: var(--fg-3); }
.kx-row .v { text-align: right; color: var(--fg-2); white-space: nowrap; }
.kx-row .v b { font-weight: 500; color: var(--fg); }
.kx-row code { font-size: 11px; color: var(--fg-3); }
.kx-row.reason { grid-template-columns: minmax(0, 1fr) minmax(0, 5.6rem) auto; }
.kx-row.reason .n { white-space: normal; line-height: 1.3; }
.kx-row.reason .n code { display: block; margin-top: 1px; }
.kx-bar { position: relative; display: block; height: 6px; border-radius: 3px; background: rgba(22, 24, 29, .07); overflow: hidden; }
.kx-bar i { position: absolute; inset: 0; border-radius: inherit; background: var(--kx-grad); transform-origin: 0 50%; transform: scaleX(var(--w, 0)); transition: transform 1.1s var(--ease); }
.kx-bar i.p90 { background: rgba(246, 209, 164, .26); }
.kx-bar.limit i { background: var(--kx-limit); }
.kx-bar.server i { background: var(--kx-server); }
.kx-bar.client i { background: var(--kx-client); }
.kx-bar.min i { transform: scaleX(max(var(--w, 0), .012)); }
.kx-pending .kx-bar i { transform: scaleX(0); }
.kx-key { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 14px; font-size: 12px; color: var(--fg-3); }
.kx-key span { display: inline-flex; align-items: center; gap: 6px; }
.kx-key i { width: 12px; height: 6px; border-radius: 3px; background: var(--kx-grad); }
.kx-key i.p90 { background: rgba(246, 209, 164, .26); }
.kx-key i.limit { background: var(--kx-limit); }
.kx-key i.server { background: var(--kx-server); }
.kx-key i.client { background: var(--kx-client); }
.kx-none { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 14px; color: var(--fg-2); }
.kx-none::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--fg-3); }
.kx-none.ok::before { background: var(--ok); box-shadow: 0 0 0 3px rgba(48, 209, 88, .16); }
.kx-quota { margin-top: 18px; }
.kx-quota .kx-rows { gap: 0; }
.kx-qrow { display: grid; grid-template-columns: minmax(0, 8rem) repeat(2, minmax(0, 1fr)); align-items: center; gap: 8px 28px; padding: 12px 0; border-top: 1px solid var(--line-2); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.kx-qrow:first-child { border-top: 0; padding-top: 2px; }
.kx-qrow .n { color: var(--fg); white-space: nowrap; }
.kx-qrow .n small { margin-left: 5px; font-size: 11.5px; color: var(--fg-3); }
.kx-qcell { display: grid; gap: 7px; min-width: 0; }
.kx-qcell p { display: flex; justify-content: space-between; gap: 10px; color: var(--fg-3); font-size: 12.5px; }
.kx-qcell p b { font-weight: 500; color: var(--fg-2); }
.kx-qlabel { display: none; }
.kx-qhead { display: grid; grid-template-columns: minmax(0, 8rem) repeat(2, minmax(0, 1fr)); gap: 28px; padding-bottom: 8px; font-size: 11.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--fg-3); }

/* Revoke, delete. */
.kx-actions { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line-2); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 28px; }
.kx-act { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 13.5px; line-height: 1.45; color: var(--fg-3); }
.kx-act b { display: block; font-weight: 500; color: var(--fg); }

/* ------------------------------------------------------------------ add a key */
.kx-paste { margin-top: clamp(48px, 8vh, 80px); padding-top: clamp(28px, 4vh, 36px); border-top: 1px solid var(--line-2); scroll-margin-top: 96px; }
.kx-form { margin-top: 18px; display: flex; gap: 10px; max-width: 40rem; }
.kx-input { flex: 1; min-width: 0; min-height: 52px; height: 52px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--fg);
  font: 15px var(--mono); transition: border-color .2s, background-color .2s; }
.kx-input::placeholder { color: var(--fg-3); }
.kx-input:hover { border-color: rgba(22, 24, 29, .2); }
.kx-input:focus-visible { outline: 2px solid var(--red-ring); outline-offset: 1px; border-color: transparent; }
.kx-form .kx-btn { flex: none; height: 52px; padding: 0 24px; border-radius: 14px; font-size: 15px; }
.kx-form-status:not(:empty) { margin-top: 14px; max-width: 40rem; }
.kx-form-status .kx-msg { margin: 0; }
.kx-note { margin-top: 28px; font-size: 13.5px; line-height: 1.6; color: var(--fg-3); }
.kx-note a { color: var(--fg-2); }

/* ------------------------------------------------------------------ the confirmation dialog */
.kx-dialog { width: min(30rem, calc(100vw - 32px)); max-width: none; padding: 0; border-radius: 22px; border: 1px solid var(--line); background: var(--surface); color: var(--fg);
  box-shadow: 0 40px 120px rgba(0, 0, 0, .7); }
.kx-dialog[open] { animation: kx-pop .32s var(--ease) both; }
.kx-dialog::backdrop { background: rgba(0, 0, 0, .62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
@keyframes kx-pop { from { opacity: 0; transform: translateY(10px) scale(.97); } }
.kx-dialog-in { padding: 26px 26px 22px; }
.kx-dialog-title { font-size: 21px; line-height: 1.25; letter-spacing: -.02em; }
.kx-dialog-body { margin-top: 12px; font-size: 15px; line-height: 1.55; color: var(--fg-2); }
.kx-dialog-body p + p, .kx-dialog-body ul { margin-top: 10px; }
.kx-dialog-body ul { display: grid; gap: 6px; padding-left: 0; }
.kx-dialog-body li { display: flex; gap: 10px; }
.kx-dialog-body li::before { content: ""; flex: none; width: 5px; height: 5px; margin-top: .62em; border-radius: 50%; background: var(--fg-3); }
.kx-dialog-body code { color: var(--fg); }
.kx-dialog-body strong { color: var(--fg); font-weight: 600; }
.kx-dialog-actions { margin-top: 24px; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }
.kx-dialog-actions .kx-btn { height: 44px; padding: 0 20px; font-size: 14.5px; }
.kx-dialog.soft .kx-danger { color: var(--fg); border-color: var(--line); background: rgba(22, 24, 29, .1); }

.kx-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ------------------------------------------------------------------ smaller screens, motion */
@media (max-width: 1000px) {
  .kx-kpis:not(.three) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kx-kpis:not(.three) .kx-kpi:nth-child(3) { border-left: 0; }
  .kx-kpis:not(.three) .kx-kpi:nth-child(n + 3) { border-top: 1px solid var(--line-2); }
  .kx-panels { grid-template-columns: minmax(0, 1fr); }
  .kx-actions { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .kx-hero { padding-top: clamp(44px, 8vh, 72px); }
  .kx-facts { gap: 8px; letter-spacing: .08em; font-size: 11px; }
  .kx-facts li { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); }
  .kx-facts li + li::before { display: none; }
  .kx-panel-head { flex-direction: column; gap: 2px; }
  .kx-panel-head span { text-align: left; }
  .kx-qlabel { display: inline; color: var(--fg-3); }
  .kx-head { flex-wrap: wrap; }
  .kx-tools { order: 3; width: 100%; margin: 0 -8px 0 0; justify-content: flex-start; }
  .kx-prefix { font-size: 16px; }
  .kx-kpi { padding: 16px; }
  .kx-kpi-v { font-size: 28px; }
  .kx-kpis.three { grid-template-columns: minmax(0, 1fr); }
  .kx-kpis.three .kx-kpi + .kx-kpi { border-left: 0; border-top: 1px solid var(--line-2); }
  .kx-chart, .kx-panel { padding: 16px; }
  .kx-plot { height: 180px; }
  .kx-qhead { display: none; }
  .kx-qrow { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .kx-range { order: 3; width: 100%; }
  .kx-range button { flex: 1; min-width: 0; }
  .kx-act { flex-direction: column; align-items: flex-start; gap: 10px; }
  .kx-form { flex-direction: column; }
  .kx-form .kx-btn { width: 100%; }
  .kx-dialog { margin: auto auto 16px; }
  .kx-dialog-actions { flex-direction: column-reverse; }
  .kx-dialog-actions .kx-btn { width: 100%; }
}
@media (max-width: 520px) {
  /* The black hole at the top right, behind the first line (its centre sits at 70% x 47% of the art box). */
  .kx-art { left: -49vw; right: auto; width: 180vw; top: -45px; bottom: auto; height: 101.25vw; }
  .kx-art.ready img { opacity: .7; }
  .kx-hero::before { background: linear-gradient(180deg, rgba(0, 0, 0, .2) 0%, var(--paper) 38%, rgba(0, 0, 0, .7) 60%, #000 100%); }
  .kx-glow { right: -50vw; top: -40vw; width: 140vw; height: 140vw; }
  .kx-title { font-size: clamp(40px, 11.6vw, 54px); }
  .kx-cta { flex-direction: column; align-items: stretch; }
  .kx-create, .kx-ghost { width: 100%; justify-content: center; }
  .kx-ghost { height: 52px; }
  .kx-axis.even span:nth-child(even) { visibility: hidden; }
}
@media (min-width: 1800px) {
  .kx-hero { padding-top: clamp(60px, 11vh, 140px); }
}
@media (prefers-reduced-motion: reduce) {
  .kx-art, .kx-glow { animation: none; }
  .kx-motes { display: none; }
  .kx-art img { transition: none; }
  .kx-loading span::after, .kx-skel::after, .kx-alert.work::before { animation: none; }
  .kx-plot.grow .kx-bars rect { animation: none; }
  .kx-bar i, .kx-ring .fill { transition: none; }
}

/* The console uses the same paper, ink and ember palette as the public pages. */
.kx-page { --kx-grad: linear-gradient(92deg, #d9441f, #a12f17); --kx-panel: var(--surface); --kx-warm-text: none; }
.kx-hero { background: radial-gradient(70% 130% at 100% 0%, var(--dawn), transparent 65%); }
.kx-hero::before { display: none; }
.kx-title { font-family: var(--serif); font-weight: 500; letter-spacing: -.025em; }
.kx-warm { background: none; color: var(--ember-text); -webkit-text-fill-color: currentColor; font-style: italic; }
.kx-h2 { font-family: var(--serif); font-size: clamp(34px, 3.8vw, 48px); font-weight: 500; }
.kx-kpi-v { font-family: var(--serif); font-size: clamp(34px, 3.6vw, 48px); font-weight: 500; }
.kx-new, .kx-card, .kx-dialog, .kx-tip { box-shadow: var(--shadow); }
.kx-new { background: var(--surface); border-color: var(--hair-2); }
.kx-ghost { background: var(--surface); border-color: var(--hair-2); }
.kx-ghost:hover { background: var(--paper-2); }
.kx-card.is-revoked, .kx-card.is-forgotten, .kx-card.is-invalid, .kx-card.is-unlisted { background: var(--paper-2); }
.kx-seg button[aria-pressed="true"] { color: var(--surface); background: var(--ink); }
.kx-ring .track { stroke: var(--hair-2); }
.kx-avg line { stroke: var(--ember-text); }
.kx-avg rect { stroke: var(--hair-2); }
.kx-bar i.p90, .kx-key i.p90 { background: rgba(217, 68, 31, .3); }

/* ------------------------------------------------------------------ System Duo: two systems, two kinds of key */
.kx-hero .kx-title em { font-style: italic; }
.kx-handoff { margin-top: 18px; }
.kx-usage-head .kx-svc { order: -1; }
.kx-svc button { min-width: 6.5rem; }
.kx-svc button[data-svc="s2"][aria-pressed="true"] { background: var(--sky); color: #fff; }
.kx-pill.s1 { color: var(--ember-text); border-color: rgba(217, 68, 31, .3); }
.kx-pill.s2 { color: var(--sky); border-color: rgba(77, 111, 163, .35); }
.kx-pill.s1::before { background: var(--ember); }
.kx-pill.s2::before { background: var(--sky); }
.kx-s2 .kx-bar i { background: linear-gradient(92deg, #4d6fa3, #7fa2d8); }
.kx-s2 .kx-key i { background: linear-gradient(92deg, #4d6fa3, #7fa2d8); }
.kx-s2 .kx-key i.rest { background: rgba(22, 24, 29, .24); }
.kx-s2 .kx-ring .fill { stroke: url(#kx-g-ring2); }
.kx-pt { margin-top: clamp(48px, 8vh, 80px); }
.kx-pt .kx-sechead { border-bottom-color: rgba(77, 111, 163, .35); }
.kx-new-calls { margin-top: 22px; display: grid; gap: 14px; }
.kx-new-calls .kx-label { display: block; margin-bottom: 8px; }
