/* =============================================================
   Danmu Core · Visual Upgrade Layer (upgrade.css)
   -------------------------------------------------------------
   Layered ON TOP of style.css. Pure visual enhancement:
   gradients, glass surfaces, depth, hover lift, entrance motion.
   No layout / responsive overrides at mobile widths, so the
   existing breakpoints in style.css stay fully intact.
   Rollback: remove the <link> to this file (and delete it).
   ============================================================= */

:root {
  --up-grad: linear-gradient(135deg, #6375ff 0%, #8959e7 100%);
  --up-grad-soft: linear-gradient(135deg, rgba(99,117,255,.12), rgba(137,89,231,.12));
  --up-radius: 18px;
  --up-radius-sm: 13px;
  --up-shadow-sm: 0 8px 24px rgba(23,34,68,.07);
  --up-shadow-md: 0 18px 48px rgba(23,34,68,.10);
  --up-shadow-lg: 0 30px 80px rgba(23,34,68,.14);
  --up-ring: 0 0 0 4px rgba(99,117,255,.16);
  --up-line: rgba(23,34,68,.08);
}

/* ---------- Global polish ---------- */
* { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
::selection { background: rgba(99,117,255,.22); color: #1b2340; }

body { transition: background-color .4s ease; }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: rgba(99,117,255,.28); border-radius: 20px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(99,117,255,.5); background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* Subtle fixed mesh behind the marketing homepage */
.site-page { position: relative; isolation: isolate; overflow-x: clip; }
.site-page::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(1200px 600px at 12% -8%, rgba(99,117,255,.10), transparent 60%),
    radial-gradient(1000px 560px at 100% 0%, rgba(137,89,231,.10), transparent 55%),
    radial-gradient(900px 700px at 50% 120%, rgba(70,217,209,.07), transparent 60%);
}
.site-page > main, .site-page > .site-footer { position: relative; z-index: 1; }

/* ============================================================
   HOMEPAGE
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 30;
  width: min(1280px, calc(100% - 48px));
  margin-inline: auto;
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  background: rgba(255,255,255,.66);
  border-radius: 0 0 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.6);
  box-shadow: 0 10px 30px rgba(23,34,68,.05);
}
.site-nav { gap: 20px; }
.site-nav a { position: relative; transition: color .2s ease; }
.site-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px;
  background: var(--up-grad); border-radius: 2px;
  transform: scaleX(0); transform-origin: left; transition: transform .25s ease;
}
.site-nav a:hover { color: var(--blue); }
.site-nav a:hover::after { transform: scaleX(1); }
.nav-console {
  border: 1px solid transparent; background: var(--up-grad); color: #fff;
  padding: 9px 16px; border-radius: 11px; font-size: 13px; font-weight: 700; cursor: pointer;
  box-shadow: 0 10px 24px rgba(99,117,255,.32); transition: transform .25s ease, box-shadow .25s ease;
}
.nav-console:hover { transform: translateY(-2px); box-shadow: 0 16px 34px rgba(99,117,255,.42); }
.nav-console span { transition: transform .25s ease; display: inline-block; }
.nav-console:hover span { transform: translateX(3px); }
.nav-menu-toggle { display: none; }
.theme-switch {
  min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 0 11px; color: #526079; border: 1px solid rgba(23,34,68,.1); border-radius: 11px;
  background: rgba(255,255,255,.72); box-shadow: 0 7px 18px rgba(23,34,68,.07);
  cursor: pointer; font-size: 12px; transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.theme-switch:hover { transform: translateY(-1px); border-color: rgba(99,117,255,.3); background: #fff; }
.theme-switch:focus-visible, .nav-menu-toggle:focus-visible { outline: 3px solid rgba(99,117,255,.28); outline-offset: 2px; }
.theme-switch span { width: 17px; font-size: 17px; line-height: 1; }
.theme-switch b { font-size: 10px; font-weight: 750; white-space: nowrap; }
.theme-switch-compact { min-height: 34px; padding-inline: 9px; }
.theme-switch-floating { position: fixed; z-index: 50; top: 20px; right: 22px; }

/* Hero */
.hero { z-index: 2; }
.hero h1 span {
  background-size: 220% 220%;
  animation: gradShift 8s ease infinite;
}
.hero-lead { color: #59617a; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 14px; border-radius: 999px;
  background: rgba(99,117,255,.08); border: 1px solid rgba(99,117,255,.18);
  color: #5560d6; font-size: 12px; font-weight: 700; letter-spacing: .01em;
}
.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #16b364;
  box-shadow: 0 0 0 0 rgba(22,179,100,.55); animation: pulse 2s infinite;
}

.button {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  border: 0; padding: 13px 22px; border-radius: 13px; font-weight: 700; font-size: 14px;
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
}
.button-glow { background: var(--up-grad); color: #fff; box-shadow: 0 14px 32px rgba(99,117,255,.34); }
.button-glow:hover { transform: translateY(-2px); box-shadow: 0 20px 44px rgba(99,117,255,.46); }
.button-glow span, .button-glow b { transition: transform .25s ease; }
.button-glow:hover b { transform: translateX(4px); }
.button-ghost { background: #fff; color: #3a4566; border: 1px solid var(--up-line); box-shadow: var(--up-shadow-sm); }
.button-ghost:hover { transform: translateY(-2px); border-color: rgba(99,117,255,.4); color: var(--blue); }

.hero-trust div strong { color: #1b2340; }
.hero-trust > i { background: var(--up-line); }

/* Terminal visual */
.hero-visual { perspective: 1200px; }
.terminal-window {
  position: relative; border-radius: 18px; overflow: hidden;
  border: 1px solid rgba(255,255,255,.7);
  box-shadow: var(--up-shadow-lg);
  background: linear-gradient(180deg, #0f1830, #0a1124);
}
.visual-glow {
  position: absolute; inset: -30% -10% auto; height: 60%; z-index: -1;
  background: radial-gradient(circle at 50% 0, rgba(99,117,255,.5), transparent 70%);
  filter: blur(40px); animation: floaty 7s ease-in-out infinite; pointer-events: none;
}
.terminal-window::after {
  content: ""; position: absolute; inset: 0; border-radius: 18px; padding: 1px;
  background: linear-gradient(135deg, rgba(99,117,255,.6), rgba(137,89,231,.3), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
.terminal-bar { background: rgba(255,255,255,.04); border-bottom: 1px solid rgba(255,255,255,.07); }
.terminal-dots i { background: rgba(255,255,255,.28); }
.float-pill {
  position: absolute; padding: 8px 13px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: rgba(255,255,255,.92); color: #2b3358; box-shadow: var(--up-shadow-md);
  border: 1px solid rgba(255,255,255,.8);
}
.pill-one { top: 12%; right: -6%; animation: floaty 6s ease-in-out infinite; }
.pill-two { bottom: 14%; left: -8%; animation: floaty 6s ease-in-out infinite reverse; }
.pill-two i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #16b364; margin-right: 6px; }

/* Marquee */
.marquee-strip {
  margin: 30px auto; width: min(1180px, calc(100% - 48px));
  border-radius: 16px; background: linear-gradient(90deg, rgba(99,117,255,.06), rgba(137,89,231,.06));
  border: 1px solid var(--up-line); color: #4a5573; font-weight: 600;
}

/* Workflow cards */
.workflow-card {
  position: relative; overflow: hidden;
  background: rgba(255,255,255,.82);
  border: 1px solid var(--up-line); border-radius: var(--up-radius);
  box-shadow: var(--up-shadow-sm);
  transition: transform .35s cubic-bezier(.2,.7,.3,1), box-shadow .35s ease, border-color .35s ease, background .35s ease, color .35s ease;
}
.workflow-card::before {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .35s ease;
  background: var(--up-grad-soft);
}
/* Hover reveal: dark background + light text (light theme only),
   echoing PLATFORM ADAPTERS' "background shift on hover" interaction. */
html:not([data-theme="dark"]) .workflow-card:hover {
  transform: translateY(-8px); box-shadow: var(--up-shadow-md);
  border-color: rgba(99,117,255,.5);
  background: linear-gradient(180deg, #111a33, #0c1530);
  color: #e7ecfb;
}
html:not([data-theme="dark"]) .workflow-card:hover h3 { color: #fff; }
html:not([data-theme="dark"]) .workflow-card:hover p { color: #aab4d6; }
html:not([data-theme="dark"]) .workflow-card:hover .step-no { color: rgba(154,166,255,.65); }
html:not([data-theme="dark"]) .workflow-card:hover::before { opacity: 0; }
.workflow-card > * { position: relative; z-index: 1; }
.icon-box {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  background: var(--up-grad); color: #fff; box-shadow: 0 10px 22px rgba(99,117,255,.3);
}
.icon-box svg { width: 24px; height: 24px; }
.step-no { color: rgba(99,117,255,.5); font-weight: 800; letter-spacing: .04em; }

/* Platform cards */
.platform-card {
  position: relative; overflow: hidden;
  background: #fff; border: 1px solid var(--up-line); border-radius: var(--up-radius);
  box-shadow: var(--up-shadow-sm);
  transition: transform .35s cubic-bezier(.2,.7,.3,1), box-shadow .35s ease, border-color .35s ease;
}
.platform-card:hover { transform: translateY(-6px); box-shadow: var(--up-shadow-md); border-color: rgba(137,89,231,.4); }
.platform-symbol {
  width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center;
  font-weight: 800; font-size: 20px; color: #fff; background: var(--up-grad);
  box-shadow: 0 10px 22px rgba(99,117,255,.28);
}
.ready-tag { display: inline-flex; align-items: center; gap: 6px; color: #16b364; font-weight: 700; font-size: 12px; }
.ready-tag i { width: 7px; height: 7px; border-radius: 50%; background: #16b364; box-shadow: 0 0 0 0 rgba(22,179,100,.5); animation: pulse 2s infinite; }

/* Playground */
.playground-card {
  position: relative; border-radius: 22px; overflow: hidden;
  background: #fff; border: 1px solid var(--up-line); box-shadow: var(--up-shadow-md);
}
.playground-card::after {
  content: ""; position: absolute; inset: 0; border-radius: 22px; padding: 1.5px; pointer-events: none;
  background: linear-gradient(135deg, rgba(99,117,255,.7), rgba(137,89,231,.35), transparent 55%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.playground-tabs span { padding: 6px 12px; border-radius: 9px; font-size: 12px; font-weight: 700; }
.playground-tabs .active { background: var(--up-grad-soft); color: #5560d6; }
.demo-form input, .url-field input {
  border: 1px solid var(--up-line); border-radius: 12px; transition: border-color .2s ease, box-shadow .2s ease;
}
.demo-form input:focus, .url-field input:focus { border-color: var(--blue); box-shadow: var(--up-ring); outline: 0; }
.url-field { border: 1px solid var(--up-line); border-radius: 12px; background: #fbfcff; transition: border-color .2s ease, box-shadow .2s ease; }
.url-field:focus-within { border-color: var(--blue); box-shadow: var(--up-ring); }
.format-switch label { cursor: pointer; }
.format-switch input:checked + span { color: var(--blue); }

/* API section */
.api-card { border-radius: var(--up-radius); background: linear-gradient(135deg, #111a33, #0c1530); color: #e7ecfb; border: 1px solid rgba(99,117,255,.25); box-shadow: var(--up-shadow-md); }
.public-format-grid article { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.09); border-radius: 14px; }
.public-format-grid span { background: var(--up-grad); color: #fff; border-radius: 9px; padding: 4px 10px; font-weight: 800; }

/* Footer */
.site-footer { position: relative; z-index: 1; border-top: 1px solid var(--up-line); background: linear-gradient(180deg, transparent, rgba(99,117,255,.04)); }

/* ============================================================
   ADMIN CONSOLE
   ============================================================ */
.admin-sidebar {
  position: relative;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(99,117,255,.18), transparent 60%),
    linear-gradient(180deg, #0d1425 0%, #0a1020 100%);
  border-right: 1px solid rgba(255,255,255,.05);
}
.admin-sidebar::before {
  content: ""; position: absolute; top: 0; left: 0; width: 3px; height: 100%;
  background: linear-gradient(180deg, #6375ff, #8959e7); opacity: .8;
}
.admin-brand .brand-mark { box-shadow: 0 9px 24px rgba(99,117,255,.35); }
.admin-nav a {
  position: relative; overflow: hidden; border-radius: 11px;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}
.admin-nav a:hover { background: rgba(112,128,244,.16); color: #fff; transform: translateX(2px); }
.admin-nav a.active {
  background: linear-gradient(90deg, rgba(99,117,255,.26), rgba(137,89,231,.12));
  color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}
.admin-nav a.active::before {
  content: ""; position: absolute; left: 0; top: 18%; bottom: 18%; width: 3px; border-radius: 3px;
  background: #8ea2ff; box-shadow: 0 0 12px rgba(142,162,255,.8);
}
.admin-nav a svg { color: #8794b8; transition: color .2s ease; }
.admin-nav a.active svg, .admin-nav a:hover svg { color: #aeb9ff; }
.sidebar-status { border-top: 1px solid rgba(255,255,255,.07); }
.sidebar-status span i { width: 8px; height: 8px; border-radius: 50%; background: #16b364; box-shadow: 0 0 0 0 rgba(22,179,100,.6); animation: pulse 2s infinite; display: inline-block; }
.sidebar-account { border: 1px solid rgba(255,255,255,.08); border-radius: 12px; background: rgba(255,255,255,.04); transition: border-color .2s ease, background .2s ease; }
.sidebar-account:hover { border-color: rgba(99,117,255,.5); background: rgba(99,117,255,.1); }
.sidebar-account-avatar, .admin-avatar {
  background: var(--up-grad); box-shadow: 0 8px 18px rgba(86,104,239,.4);
}
.sidebar-logout button { transition: background .2s ease, color .2s ease; }
.sidebar-logout button:hover { background: rgba(229,77,93,.16); color: #ffb3bc; }

.admin-topbar {
  background: rgba(255,255,255,.8); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  box-shadow: 0 8px 30px rgba(23,34,68,.05);
}
.topbar-kicker { color: var(--blue); font-weight: 800; letter-spacing: .14em; font-size: 10px; }
.admin-topbar h1 { background: linear-gradient(90deg, #1b2340, #44508a); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Metric cards */
.metric-card {
  position: relative; overflow: hidden; isolation: isolate;
  background: #fff; border: 1px solid var(--up-line); border-radius: var(--up-radius);
  box-shadow: var(--up-shadow-sm);
  transition: transform .35s cubic-bezier(.2,.7,.3,1), box-shadow .35s ease, border-color .35s ease;
}
.metric-card::after {
  content: ""; position: absolute; right: -30px; top: -30px; width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, rgba(99,117,255,.12), transparent 70%); z-index: -1;
}
.metric-card:hover { transform: translateY(-7px); box-shadow: var(--up-shadow-md); border-color: rgba(99,117,255,.4); }
.metric-card em { color: rgba(23,34,68,.28); font-weight: 800; letter-spacing: .08em; font-style: normal; }
.metric-card strong { color: #1b2340; }
.metric-icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; color: #fff; box-shadow: 0 10px 22px rgba(99,117,255,.25); }
.metric-icon svg { width: 24px; height: 24px; }
.metric-card.blue .metric-icon { background: linear-gradient(135deg,#6375ff,#7d63f0); }
.metric-card.blue::after { background: radial-gradient(circle, rgba(99,117,255,.14), transparent 70%); }
.metric-card.violet .metric-icon { background: linear-gradient(135deg,#9a6cf6,#b65cf0); }
.metric-card.violet::after { background: radial-gradient(circle, rgba(154,108,246,.14), transparent 70%); }
.metric-card.mint .metric-icon { background: linear-gradient(135deg,#1fb574,#46d9d1); }
.metric-card.mint::after { background: radial-gradient(circle, rgba(22,179,116,.13), transparent 70%); }
.metric-card.coral .metric-icon { background: linear-gradient(135deg,#f0635f,#e54d5d); }
.metric-card.coral::after { background: radial-gradient(circle, rgba(229,77,93,.13), transparent 70%); }

/* Panels */
.admin-panel {
  position: relative; background: #fff; border: 1px solid var(--up-line); border-radius: var(--up-radius);
  box-shadow: var(--up-shadow-sm);
  transition: box-shadow .35s ease, border-color .35s ease, transform .35s ease;
}
.admin-panel:hover { box-shadow: var(--up-shadow-md); border-color: rgba(99,117,255,.28); }
.panel-heading h3 { color: #1b2340; letter-spacing: -.01em; }
.panel-kicker { color: var(--blue); font-weight: 800; letter-spacing: .12em; font-size: 10px; }
.status-badge.success { color: #0f9d63; background: rgba(22,179,100,.12); border: 1px solid rgba(22,179,100,.3); }
.status-badge.success i { width: 7px; height: 7px; border-radius: 50%; background: #16b364; box-shadow: 0 0 0 0 rgba(22,179,100,.6); animation: pulse 2s infinite; display: inline-block; }

/* Pipeline */
.pipeline-step { background: #f7f9ff; border: 1px solid var(--up-line); border-radius: 12px; }
.pipeline-step span { background: var(--up-grad); color: #fff; border-radius: 8px; }
.pipeline-step i { color: #16b364; font-weight: 800; }
.pipeline em { color: #b9c1d6; font-weight: 800; }

.runtime-list > div { border: 1px solid var(--up-line); border-radius: 11px; background: #f8faff; }
.runtime-list code { color: #59617a; }
.runtime-list b.ok { color: #16b364; }
.runtime-list b.bad { color: var(--red); }
.runtime-list b.neutral { color: #b08a1e; }

.endpoint-box { border: 1px solid var(--up-line); border-radius: 12px; background: #f8faff; transition: border-color .2s ease, box-shadow .2s ease; }
.endpoint-box:focus-within, .endpoint-box:hover { border-color: rgba(99,117,255,.45); box-shadow: var(--up-ring); }
.endpoint-box > span { background: var(--up-grad); color: #fff; border-radius: 8px; font-weight: 800; }
.endpoint-box button { color: var(--blue); transition: transform .2s ease, color .2s ease; }
.endpoint-box button:hover { color: var(--violet); transform: scale(1.08); }
.text-link { color: var(--blue); font-weight: 700; }
.text-link:hover { color: var(--violet); }

/* Platform grid in admin */
.admin-platform-grid article { border: 1px solid var(--up-line); border-radius: 13px; background: #f8faff; transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease; }
.admin-platform-grid article:hover { transform: translateY(-4px); box-shadow: var(--up-shadow-sm); border-color: rgba(99,117,255,.4); }
.admin-platform-grid b.online { color: #16b364; }
.admin-platform-grid b.online i { width: 7px; height: 7px; border-radius: 50%; background: #16b364; display: inline-block; box-shadow: 0 0 0 0 rgba(22,179,100,.6); animation: pulse 2s infinite; }
.admin-platform-grid b.offline { color: var(--red); }
.source-index { background: var(--up-grad-soft); color: #5560d6; border-radius: 8px; font-weight: 800; }

/* Test panel */
.test-input-row .input-with-icon { border: 1px solid var(--up-line); border-radius: 12px; background: #f8faff; transition: border-color .2s ease, box-shadow .2s ease; }
.test-input-row .input-with-icon:focus-within { border-color: var(--blue); box-shadow: var(--up-ring); }
.test-input-row input { border: 0; background: transparent; }
.test-summary > div { background: #f8faff; border: 1px solid var(--up-line); border-radius: 12px; }
.test-summary strong { color: #1b2340; }
.result-details[open] { border-color: rgba(99,117,255,.3); }
.result-details pre { background: #0d1425; color: #d7e0fb; border-radius: 12px; }
.test-placeholder { border: 1px dashed var(--up-line); border-radius: 14px; color: #8b95ad; }

/* Maintenance */
.maintenance-panel { background: linear-gradient(135deg, #fff, #f7f9ff); }
.maintenance-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--up-grad-soft); color: var(--blue); }
.maintenance-actions form { display: inline-block; }

/* Buttons (admin) */
.admin-primary-button {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; border: 0;
  padding: 11px 20px; border-radius: 12px; font-weight: 700; color: #fff; background: var(--up-grad);
  box-shadow: 0 12px 26px rgba(99,117,255,.32); transition: transform .25s ease, box-shadow .25s ease;
}
.admin-primary-button:hover { transform: translateY(-2px); box-shadow: 0 18px 38px rgba(99,117,255,.44); }
.admin-secondary-button {
  cursor: pointer; border: 1px solid rgba(99,117,255,.35); background: #fff; color: var(--blue);
  padding: 11px 18px; border-radius: 12px; font-weight: 700; transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
}
.admin-secondary-button:hover:not(:disabled) { background: var(--up-grad-soft); transform: translateY(-2px); box-shadow: var(--up-ring); }
.admin-secondary-button:disabled, .admin-danger-button:disabled { opacity: .5; cursor: not-allowed; }
.admin-danger-button {
  cursor: pointer; border: 1px solid rgba(229,77,93,.4); background: #fff; color: var(--red);
  padding: 11px 18px; border-radius: 12px; font-weight: 700; transition: background .2s ease, transform .2s ease;
}
.admin-danger-button:hover:not(:disabled) { background: rgba(229,77,93,.1); transform: translateY(-2px); }

/* Alerts */
.admin-alert { border-radius: 13px; border: 1px solid var(--up-line); box-shadow: var(--up-shadow-sm); }
.admin-alert.success { background: linear-gradient(135deg, rgba(22,179,100,.1), rgba(22,179,100,.04)); border-color: rgba(22,179,100,.3); }
.admin-alert.success span { background: #16b364; color: #fff; }
.admin-alert.error { background: linear-gradient(135deg, rgba(229,77,93,.1), rgba(229,77,93,.04)); border-color: rgba(229,77,93,.3); }
.admin-alert.error span { background: var(--red); color: #fff; }

/* Key status badges */
.key-status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.key-status.active { background: rgba(22,179,100,.12); color: #0f9d63; }
.key-status.active::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #16b364; }
.key-status.revoked { background: rgba(229,77,93,.12); color: #d23a4a; }
.key-status.revoked::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--red); }

/* Tables (billing / logs) */
.billing-table-wrap, .user-table-wrap { border: 1px solid var(--up-line); border-radius: 14px; overflow: hidden; box-shadow: var(--up-shadow-sm); }
.billing-table, .user-table, .logs-table { width: 100%; border-collapse: collapse; background: #fff; }
.billing-table thead th, .user-table thead th {
  background: #f7f9ff; color: #56607a; font-weight: 700; font-size: 12px; text-align: left;
  padding: 13px 16px; border-bottom: 1px solid var(--up-line);
}
.billing-table tbody td, .user-table tbody td { padding: 13px 16px; border-bottom: 1px solid #f0f3f9; color: #3a4566; }
.billing-table tbody tr, .user-table tbody tr { transition: background .18s ease; }
.billing-table tbody tr:hover, .user-table tbody tr:hover { background: #f7f9ff; }
.billing-table tbody tr:last-child td, .user-table tbody tr:last-child td { border-bottom: 0; }
.log-pagination a { border: 1px solid var(--up-line); border-radius: 9px; transition: background .2s ease, color .2s ease; }
.log-pagination a:hover { background: var(--up-grad-soft); color: var(--blue); }
.log-pagination a.active { background: var(--up-grad); color: #fff; border-color: transparent; }

/* ============================================================
   USER CONSOLE
   ============================================================ */
.user-sidebar {
  position: relative;
  background: radial-gradient(120% 60% at 50% -10%, rgba(99,117,255,.16), transparent 60%), linear-gradient(180deg, #11182b, #0c1224);
  border-right: 1px solid rgba(255,255,255,.05);
}
.user-sidebar::before {
  content: ""; position: absolute; top: 0; left: 0; width: 3px; height: 100%;
  background: linear-gradient(180deg, #6375ff, #8959e7); opacity: .8;
}
.user-side-nav a { transition: background .2s ease, color .2s ease, transform .2s ease; }
.user-side-nav a:hover { transform: translateX(2px); }
.user-side-nav a.active { box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.user-side-account { border: 1px solid rgba(255,255,255,.08); border-radius: 12px; background: rgba(255,255,255,.04); transition: border-color .2s ease, background .2s ease; }
.user-side-account:hover { border-color: rgba(99,117,255,.5); background: rgba(99,117,255,.1); }
.user-sidebar > form button { transition: background .2s ease, color .2s ease; }
.user-sidebar > form button:hover { background: rgba(229,77,93,.16); color: #ffb3bc; }
.user-topbar { background: rgba(255,255,255,.8); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: 0 8px 30px rgba(23,34,68,.05); }
.user-topbar h1 { background: linear-gradient(90deg, #1b2340, #44508a); -webkit-background-clip: text; background-clip: text; color: transparent; }

.user-hero {
  position: relative; overflow: hidden; border-radius: var(--up-radius);
  background: linear-gradient(135deg, #111a33, #0c1530); color: #e7ecfb; border: 1px solid rgba(99,117,255,.25);
  box-shadow: var(--up-shadow-md);
}
.user-hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(circle, rgba(99,117,255,.4), transparent 70%); }
.user-hero p { color: #9aa6cf; }
.user-hero h2 { color: #fff; }

.user-card {
  position: relative; background: #fff; border: 1px solid var(--up-line); border-radius: var(--up-radius);
  box-shadow: var(--up-shadow-sm); transition: box-shadow .35s ease, border-color .35s ease, transform .35s ease;
}
.user-card:hover { box-shadow: var(--up-shadow-md); border-color: rgba(99,117,255,.28); }
.user-card-heading h2 { color: #1b2340; letter-spacing: -.01em; }
.user-card-heading span { color: var(--blue); font-weight: 800; letter-spacing: .12em; font-size: 10px; }

.user-stat-grid article, .traffic-stat-grid article {
  background: #fff; border: 1px solid var(--up-line); border-radius: var(--up-radius); box-shadow: var(--up-shadow-sm);
  transition: transform .35s cubic-bezier(.2,.7,.3,1), box-shadow .35s ease, border-color .35s ease;
}
.user-stat-grid article:hover, .traffic-stat-grid article:hover { transform: translateY(-6px); box-shadow: var(--up-shadow-md); border-color: rgba(99,117,255,.4); }
.user-stat-grid strong, .traffic-stat-grid strong { color: #1b2340; }
.user-stat-grid small, .traffic-stat-grid small { color: #8b95ad; }

/* Quick links */
.quick-links a { transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease; }
.quick-links a:hover { transform: translateY(-4px); box-shadow: var(--up-shadow-md); border-color: rgba(99,117,255,.4); }
.quick-links b { color: #2b3358; }
.quick-links span { color: #8b95ad; }

/* Traffic chart */
.traffic-chart { display: flex; align-items: flex-end; gap: 10px; padding: 18px 6px 0; }
.traffic-bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.traffic-bar-strong, .traffic-bar strong { color: #1b2340; font-weight: 800; font-size: 12px; }
.traffic-bar-stack { width: 100%; max-width: 38px; border-radius: 9px; background: #eef1f8; overflow: hidden; display: flex; align-items: flex-end; box-shadow: inset 0 0 0 1px var(--up-line); }
.traffic-bar-stack i { width: 100%; border-radius: 9px 9px 0 0; background: linear-gradient(180deg, #6375ff, #8959e7); box-shadow: 0 0 18px rgba(99,117,255,.4); transition: height .6s cubic-bezier(.2,.7,.3,1); }
.traffic-bar span { color: #8b95ad; font-size: 11px; }

/* API endpoints table */
.api-version-badge { display: inline-block; padding: 3px 10px; border-radius: 8px; font-weight: 800; font-size: 12px; }
.api-version-badge.v1 { background: rgba(99,117,255,.14); color: #5560d6; }
.api-version-badge.v2 { background: rgba(137,89,231,.14); color: #7a4fd0; }
.api-version-badge.submit { background: rgba(26,170,120,.14); color: #16845f; }
.api-cell code { background: #f6f8fc; border: 1px solid var(--up-line); border-radius: 9px; color: #3a4566; }
.api-cell button { color: var(--blue); font-weight: 700; border: 1px solid var(--up-line); border-radius: 9px; padding: 6px 12px; transition: background .2s ease, transform .2s ease; }
.api-cell button:hover:not(:disabled) { background: var(--up-grad-soft); transform: translateY(-1px); }
.submission-api-help { align-items: start; grid-template-columns: minmax(190px,.7fr) minmax(0,1.6fr); }
.submission-api-help p { color: #7d879a; font-size: 11px; line-height: 1.7; }
.user-topbar-actions { display: flex; align-items: center; gap: 12px; }
.user-topbar-actions > a { color: #6476e7; font-size: 11px; font-weight: 700; }

@media (max-width: 820px) {
  .site-header { min-height: 70px; border-radius: 0 0 16px 16px; }
  .nav-menu-toggle {
    width: 42px; height: 42px; display: grid; place-content: center; gap: 4px;
    padding: 0; border: 1px solid var(--up-line); border-radius: 11px; background: rgba(255,255,255,.82); cursor: pointer;
  }
  .nav-menu-toggle i { width: 18px; height: 2px; display: block; border-radius: 2px; background: #42506d; transition: transform .2s ease, opacity .2s ease; }
  .site-header.is-nav-open .nav-menu-toggle i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .site-header.is-nav-open .nav-menu-toggle i:nth-child(2) { opacity: 0; }
  .site-header.is-nav-open .nav-menu-toggle i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  .site-nav {
    position: absolute; top: calc(100% + 9px); left: 0; right: 0; display: none; align-items: stretch; gap: 5px;
    padding: 12px; color: #3f4b64; border: 1px solid rgba(23,34,68,.09); border-radius: 16px;
    background: rgba(255,255,255,.96); box-shadow: 0 22px 55px rgba(23,34,68,.16); backdrop-filter: blur(20px);
  }
  .site-header.is-nav-open .site-nav { display: flex; }
  .site-nav > a:not(.nav-console) { min-height: 42px; display: flex; align-items: center; padding: 0 12px; border-radius: 10px; }
  .site-nav > a:not(.nav-console):hover { background: rgba(99,117,255,.08); }
  .site-nav a::after { display: none; }
  .site-nav .theme-switch, .site-nav .nav-console { min-height: 42px; width: 100%; box-shadow: none; }
  .theme-switch-floating { top: 14px; right: 14px; }
}

@media (max-width: 620px) {
  .theme-switch-compact b { display: none; }
  .theme-switch-compact { width: 36px; padding: 0; }
  .user-topbar-actions > a { display: none; }
}

/* Account modal (shared) */
.account-modal-dialog, .auth-dialog {
  border-radius: 22px; border: 1px solid rgba(255,255,255,.6);
  box-shadow: var(--up-shadow-lg); background: rgba(255,255,255,.92);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
}
.account-profile { border-bottom: 1px solid var(--up-line); }
.account-profile span { background: var(--up-grad); color: #fff; box-shadow: 0 8px 18px rgba(86,104,239,.35); }
.account-modal-tabs button { color: #6b768f; font-weight: 700; }
.account-modal-tabs button.active { color: var(--blue); box-shadow: inset 0 -2px 0 var(--blue); }
.account-form input:focus { border-color: var(--blue); box-shadow: var(--up-ring); }

/* ============================================================
   LOGIN PAGES (admin + user)
   ============================================================ */
.login-page { position: relative; min-height: 100vh; overflow: hidden; }
.login-page::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(1100px 600px at 0% 0%, rgba(99,117,255,.12), transparent 55%),
    radial-gradient(900px 600px at 100% 100%, rgba(137,89,231,.12), transparent 55%),
    linear-gradient(180deg, #fbfcff, #f3f6ff);
}
.login-shell { position: relative; z-index: 1; }
.login-ambient { filter: blur(20px); opacity: .8; }
.login-story {
  position: relative; overflow: hidden; color: #eaf0ff;
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(99,117,255,.5), transparent 55%),
    linear-gradient(160deg, #131d3a, #0c1430);
  border-radius: 26px; box-shadow: var(--up-shadow-lg);
}
.login-story::after {
  content: ""; position: absolute; right: -60px; bottom: -60px; width: 320px; height: 320px; border-radius: 50%;
  background: radial-gradient(circle, rgba(137,89,231,.45), transparent 70%); animation: floaty 8s ease-in-out infinite;
}
.login-story > * { position: relative; z-index: 1; }
.login-kicker { display: inline-flex; align-items: center; gap: 8px; color: #9fb0ff; font-weight: 800; letter-spacing: .14em; font-size: 11px; }
.login-kicker i { width: 8px; height: 8px; border-radius: 50%; background: #6ee7b7; box-shadow: 0 0 12px #6ee7b7; display: inline-block; }
.login-story h1 { background: linear-gradient(90deg, #ffffff, #c9d4ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-flow span { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); border-radius: 10px; color: #cdd8ff; }
.login-flow i { background: var(--up-grad); color: #fff; border-radius: 8px; font-weight: 800; }
.login-flow b { color: #7e8cff; }
.login-form-panel { display: grid; place-items: center; }
.login-form-wrap {
  width: min(420px, 100%); background: rgba(255,255,255,.85); border: 1px solid rgba(255,255,255,.7);
  border-radius: 24px; padding: 38px; box-shadow: var(--up-shadow-md);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
}
.login-heading h2 { color: #1b2340; letter-spacing: -.02em; }
.login-heading span { color: var(--blue); font-weight: 800; letter-spacing: .13em; font-size: 11px; }
.back-home { color: #6b768f; font-weight: 600; transition: color .2s ease; }
.back-home:hover { color: var(--blue); }
.login-input { border: 1px solid var(--up-line); border-radius: 12px; background: #fbfcff; transition: border-color .2s ease, box-shadow .2s ease; }
.login-input:focus-within { border-color: var(--blue); box-shadow: var(--up-ring); }
.login-input input { border: 0; background: transparent; }
.login-input svg { color: #9aa3b8; }
.password-toggle { color: var(--blue); font-weight: 700; }
.login-submit {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; border: 0; width: 100%;
  padding: 14px; border-radius: 13px; font-weight: 800; font-size: 15px; color: #fff; background: var(--up-grad);
  box-shadow: 0 14px 32px rgba(99,117,255,.34); transition: transform .25s ease, box-shadow .25s ease;
}
.login-submit:hover { transform: translateY(-2px); box-shadow: 0 20px 44px rgba(99,117,255,.46); }
.login-submit b { transition: transform .25s ease; }
.login-submit:hover b { transform: translateX(4px); }
.login-security { color: #6b768f; border-top: 1px solid var(--up-line); padding-top: 16px; }
.login-security svg { color: #16b364; }
.user-switch a { color: var(--blue); font-weight: 700; }
.user-notice, .admin-alert { border-radius: 12px; }

/* ============================================================
   ENTRANCE MOTION (only when motion is allowed)
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  .hero-copy > * { animation: up .7s both; }
  .hero-copy > *:nth-child(1) { animation-delay: .04s; }
  .hero-copy > *:nth-child(2) { animation-delay: .12s; }
  .hero-copy > *:nth-child(3) { animation-delay: .2s; }
  .hero-copy > *:nth-child(4) { animation-delay: .28s; }
  .hero-copy > *:nth-child(5) { animation-delay: .36s; }
  .hero-visual { animation: up .9s .2s both; }
  .eyebrow, .hero-trust { animation: up .7s .4s both; }

  .workflow-card, .platform-card { animation: up .7s both; }
  .workflow-grid .workflow-card:nth-child(1) { animation-delay: .05s; }
  .workflow-grid .workflow-card:nth-child(2) { animation-delay: .12s; }
  .workflow-grid .workflow-card:nth-child(3) { animation-delay: .19s; }
  .workflow-grid .workflow-card:nth-child(4) { animation-delay: .26s; }
  .workflow-grid .workflow-card:nth-child(5) { animation-delay: .33s; }

  .platform-grid .platform-card { animation: up .7s both; }
  .metric-card { animation: up .6s both; }
  .metric-grid .metric-card:nth-child(1) { animation-delay: .05s; }
  .metric-grid .metric-card:nth-child(2) { animation-delay: .12s; }
  .metric-grid .metric-card:nth-child(3) { animation-delay: .19s; }
  .metric-grid .metric-card:nth-child(4) { animation-delay: .26s; }

  .admin-panel, .user-card, .user-stat-grid article, .traffic-stat-grid article { animation: up .7s both; }
  .dashboard-grid .admin-panel:nth-child(1) { animation-delay: .06s; }
  .dashboard-grid .admin-panel:nth-child(2) { animation-delay: .14s; }
  .admin-panel.platform-panel { animation-delay: .1s; }
  .admin-panel.test-panel { animation-delay: .16s; }
  .admin-panel.maintenance-panel { animation-delay: .22s; }

  .user-hero { animation: up .7s both; }
}

@keyframes up { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(22,179,100,.5); } 70% { box-shadow: 0 0 0 8px rgba(22,179,100,0); } 100% { box-shadow: 0 0 0 0 rgba(22,179,100,0); } }
@keyframes gradShift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

/* ============================================================
   DESKTOP-ONLY spacing refinements (never touch mobile layout)
   ============================================================ */
@media (min-width: 1081px) {
  .metric-card { padding: 24px 22px; }
  .admin-panel { padding: 26px 28px; }
  .user-card { padding: 26px 28px; }
  .workflow-card { padding: 26px 24px; }
  .platform-card { padding: 22px 24px; }
  .hero { gap: 90px; }
  .dashboard-grid { gap: 22px; }
  .admin-content { padding: 30px 38px 60px; }
  .user-hero { padding: 34px 36px; }
  .auth-dialog, .account-modal-dialog { padding: 34px 32px; }
}
