/* VintageAuth — OLED Keys Manager (mobile-first, 390px+) */
.km-oled {
  --km-bg: #070707;
  --km-card: #101010;
  --km-card-2: #141414;
  --km-border: #222222;
  --km-text: #ffffff;
  --km-muted: #6b7280;
  --km-dim: #9ca3af;
  --km-emerald: #10b981;
  --km-amber: #f59e0b;
  --km-danger: #ef4444;
  --km-safe: max(12px, env(safe-area-inset-bottom));
  box-sizing: border-box;
  width: 100%;
  max-width: 430px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 0 14px calc(18px + var(--km-safe));
  background: var(--km-bg);
  color: var(--km-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
.km-oled *,
.km-oled *::before,
.km-oled *::after {
  box-sizing: border-box;
}
.km-oled .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.km-oled-role-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 10px 0 4px;
  padding: 4px;
  border-radius: 12px;
  background: #101014;
  border: 1px solid var(--km-border);
}
.km-oled-role-switch button {
  min-height: 36px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--km-muted);
  font-size: 0.78rem;
  font-weight: 650;
  cursor: pointer;
}
.km-oled-role-switch button.is-on {
  background: #1c1c22;
  color: #fff;
}

.km-oled-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding-top: 6px;
}
.km-oled-top-spacer {
  flex: 1;
}
.km-oled-icon-btn {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--km-border);
  background: var(--km-card);
  color: #e5e7eb;
  cursor: pointer;
}
.km-oled-burger {
  display: grid;
  gap: 4px;
  width: 16px;
}
.km-oled-burger i {
  display: block;
  height: 1.5px;
  border-radius: 99px;
  background: #e5e7eb;
}
.km-oled-avatar {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: linear-gradient(145deg, #2a2a32, #151518);
  border: 1px solid #333;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #ddd;
}
.km-oled-online {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--km-emerald);
  border: 2px solid var(--km-bg);
}

.km-oled-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin: 8px 0 14px;
}
.km-oled-title-row h1 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 720;
  letter-spacing: -0.035em;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.km-oled-role-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--km-border);
  background: #151518;
  color: var(--km-dim);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.km-oled-account-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--km-border);
  background: var(--km-card);
  color: var(--km-dim);
  font-size: 0.68rem;
  font-weight: 650;
}

.km-oled-balance {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-radius: 16px;
  background: var(--km-card);
  border: 1px solid var(--km-border);
  margin-bottom: 12px;
}
.km-oled-balance-main {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}
.km-oled-balance-main span {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--km-muted);
}
.km-oled-balance-main strong {
  font-size: 1.35rem;
  font-weight: 720;
  letter-spacing: -0.03em;
}
.km-oled-balance-main em {
  font-style: normal;
  font-size: 0.72rem;
  color: var(--km-muted);
  font-weight: 500;
}
.km-oled-gen {
  flex-shrink: 0;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 0;
  background: #fff;
  color: #0a0a0c;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.km-oled-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.km-oled-kpi {
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--km-card);
  border: 1px solid var(--km-border);
  display: grid;
  gap: 2px;
  min-height: 56px;
}
.km-oled-kpi span {
  font-size: 0.52rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--km-muted);
}
.km-oled-kpi strong {
  font-size: 1.05rem;
  font-weight: 720;
  letter-spacing: -0.03em;
}
.km-oled-kpi strong.is-accent {
  color: var(--km-emerald);
}

.km-oled-filters {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}
.km-oled-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 10px 0 12px;
  border-radius: 14px;
  background: var(--km-card);
  border: 1px solid var(--km-border);
}
.km-oled-search > i {
  color: var(--km-muted);
  font-size: 0.95rem;
}
.km-oled-search input {
  flex: 1;
  min-width: 0;
  height: 44px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 0.9rem;
  outline: none;
}
.km-oled-search input::placeholder {
  color: #5b6170;
}
.km-oled-filter-ico {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  border: 1px solid var(--km-border);
  background: #17171c;
  color: #cfd3dc;
  cursor: pointer;
}
.km-oled-selects {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.km-oled-selects select {
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--km-border);
  background: var(--km-card);
  color: #e5e7eb;
  font-size: 0.82rem;
  font-weight: 650;
  padding: 0 28px 0 12px;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #888 50%),
    linear-gradient(135deg, #888 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.km-oled-select-page {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  color: var(--km-dim);
  font-size: 0.78rem;
  font-weight: 550;
}
.km-oled-select-page input {
  width: 16px;
  height: 16px;
  accent-color: #e5e7eb;
}

.km-oled-list {
  display: grid;
  gap: 10px;
}
.km-oled-card {
  padding: 11px;
  border-radius: 14px;
  background: var(--km-card);
  border: 1px solid var(--km-border);
  display: grid;
  gap: 8px;
}
.km-oled-card.is-selected {
  border-color: #3f3f46;
  background: #151519;
}
.km-oled-card-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 34px auto 28px;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.km-oled-card-row input {
  width: 16px;
  height: 16px;
  accent-color: #e5e7eb;
}
.km-oled-key {
  min-width: 0;
  border: 0;
  background: none;
  color: #fff;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  padding: 0;
}
.km-oled-copy,
.km-oled-more {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  line-height: 1;
}
.km-oled-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 700;
  white-space: nowrap;
}
.km-oled-status i {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
  display: inline-block;
}
.km-oled-status.is-unused {
  color: #9ca3af;
  background: rgba(156, 163, 175, 0.14);
}
.km-oled-status.is-used {
  color: var(--km-emerald);
  background: rgba(16, 185, 129, 0.14);
}
.km-oled-status.is-expired,
.km-oled-status.is-banned {
  color: var(--km-danger);
  background: rgba(239, 68, 68, 0.14);
}

.km-oled-user {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
}
.km-oled-user-av {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #22222a;
  display: grid;
  place-items: center;
  font-size: 0.62rem;
  font-weight: 700;
  color: #ddd;
}
.km-oled-user strong {
  font-size: 0.84rem;
  font-weight: 650;
}
.km-oled-user em {
  font-style: normal;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--km-muted);
  border: 1px solid var(--km-border);
  border-radius: 999px;
  padding: 2px 7px;
  background: #17171c;
}
.km-oled-meta,
.km-oled-submeta,
.km-oled-date {
  margin: 0;
  color: var(--km-muted);
  font-size: 0.74rem;
  font-weight: 500;
  line-height: 1.35;
}
.km-oled-submeta {
  margin-top: 3px;
}
.km-oled-date {
  margin: 0;
  padding-top: 7px;
  border-top: 1px solid #1c1c20;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.66rem;
}
.km-oled-empty {
  text-align: center;
  color: var(--km-muted);
  padding: 28px 10px;
  font-size: 0.9rem;
}

.km-oled-sheet-root {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  align-items: end;
}
.km-oled-sheet-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.62);
}
.km-oled-sheet {
  position: relative;
  z-index: 1;
  width: min(430px, 100%);
  margin: 0 auto;
  padding: 10px 16px calc(18px + var(--km-safe));
  border-radius: 22px 22px 0 0;
  background: #121215;
  border: 1px solid var(--km-border);
  border-bottom: 0;
  box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.45);
  animation: kmSheetUp 0.22s ease;
}
@keyframes kmSheetUp {
  from {
    transform: translateY(18px);
    opacity: 0.6;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
.km-oled-sheet-handle {
  width: 42px;
  height: 4px;
  border-radius: 99px;
  background: #2f2f36;
  margin: 2px auto 12px;
}
.km-oled-sheet h2 {
  margin: 0 0 12px;
  font-size: 1.1rem;
  font-weight: 700;
}
.km-oled-sheet-key {
  margin: 0 0 10px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  color: var(--km-dim);
  word-break: break-all;
}
.km-oled-field {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}
.km-oled-field span {
  font-size: 0.72rem;
  color: var(--km-muted);
  font-weight: 650;
}
.km-oled-field select,
.km-oled-field input {
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid var(--km-border);
  background: #17171c;
  color: #fff;
  padding: 0 12px;
  font-size: 0.9rem;
}
.km-oled-sheet-primary,
.km-oled-sheet-action {
  width: 100%;
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid var(--km-border);
  background: #1a1a20;
  color: #fff;
  font-size: 0.92rem;
  font-weight: 650;
  cursor: pointer;
  margin-top: 8px;
}
.km-oled-sheet-primary {
  background: #fff;
  color: #0a0a0c;
  border: 0;
  margin-top: 14px;
}
.km-oled-sheet-action.is-danger {
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.35);
}

.km-oled-toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--km-safe));
  transform: translateX(-50%);
  z-index: 13000;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: #111;
  border: 1px solid #333;
  color: #fff;
  display: inline-flex;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 650;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

/* Production Keys Manager — premium compact mobile SaaS (v4) */
@media (max-width: 900px), ((hover: none) and (pointer: coarse)) {
  :root {
    /* Keys manager — a step blacker than the rest of the portal */
    --km-bg: #070707;
    --km-card: #101010;
    --km-card-2: #141414;
    --km-border: #222222;
    --km-border-soft: #1a1a1a;
    --km-text: #fafafa;
    --km-muted: #a3a3a3;
    --km-dim: #737373;
    --km-emerald: #22c55e;
    --km-amber: #f59e0b;
    --km-danger: #ef4444;
    --km-safe: max(12px, env(safe-area-inset-bottom, 0px));
  }

  /* ── Shell chrome: tighter header / page padding on Keys ── */
  html:not(#_) .va-shell--portal:has(.rp-keys-oled-active) .va-mobile-top,
  html:not(#_) .va-shell--portal:has(.rp-keys-manager) .va-mobile-top {
    padding: 0.28rem 0.7rem !important;
    padding-top: max(0.28rem, env(safe-area-inset-top, 0px)) !important;
    border-bottom-color: #161616 !important;
    background: #070707 !important;
    min-height: 44px !important;
  }
  html:not(#_) .va-shell--portal:has(.rp-keys-oled-active) .va-page,
  html:not(#_) .va-shell--portal:has(.rp-keys-manager) .va-page {
    padding: 0.4rem 0.7rem calc(1rem + var(--km-safe)) !important;
  }

  /* Hide duplicate toolbar Generate / wallet — OLED balance owns CTA */
  html:not(#_) .rp-root.rp-keys-oled-active .rp-toolbar .rp-toolbar-actions,
  html:not(#_) .rp-root.rp-keys-oled-active .rp-toolbar .rp-toolbar-actions.rp-keys-actions,
  html:not(#_) .rp-root.rp-keys-oled-active .rp-toolbar .rp-keys-toolbar-desktop,
  html:not(#_) .rp-root:has(.rp-keys-manager) .rp-toolbar .rp-toolbar-actions,
  html:not(#_) .rp-root:has(.rp-keys-oled) .rp-toolbar .rp-toolbar-actions,
  html:not(#_) .rp-root:has(.rp-keys-manager) .rp-toolbar .rp-toolbar-actions.rp-keys-actions {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
  }
  /* Keep subtitle like Home / Sub Seller */
  html:not(#_) .rp-root .rp-toolbar .rp-hint {
    display: block !important;
    margin: 0.2rem 0 0 !important;
    font-size: 0.78rem !important;
    font-weight: 500 !important;
    color: #a3a3a3 !important;
    line-height: 1.3 !important;
  }
  html:not(#_) .rp-root.rp-keys-oled-active .rp-toolbar,
  html:not(#_) .rp-root:has(.rp-keys-manager) .rp-toolbar,
  html:not(#_) .rp-root:has(.rp-keys-oled) .rp-toolbar {
    margin: 0 0 0.55rem !important;
    padding: 0 !important;
    gap: 0 !important;
    min-height: 0 !important;
    border: 0 !important;
    background: transparent !important;
  }
  html:not(#_) .rp-root .rp-toolbar h1 {
    font-size: 1.55rem !important;
    font-weight: 720 !important;
    letter-spacing: -0.035em !important;
    margin: 0 !important;
    line-height: 1.15 !important;
    color: #fff !important;
  }

  /* ── Keys manager root ── */
  html:not(#_) .rp-root .rp-keys-manager,
  html:not(#_) .rp-root .rp-keys-oled {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: clip !important;
  }

  /* ── Balance + Generate ── */
  html:not(#_) .rp-root .rp-keys-manager .rp-keys-balance-oled.rp-mobile-only,
  html:not(#_) .rp-root .rp-keys-oled .rp-keys-balance-oled.rp-mobile-only,
  html:not(#_) .rp-root .rp-keys-balance-oled {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 12px 12px 12px 14px !important;
    border-radius: 14px !important;
    background: var(--km-card) !important;
    border: 1px solid var(--km-border) !important;
    margin: 0 !important;
    box-shadow: none !important;
  }
  html:not(#_) .rp-root .rp-keys-balance-oled > div:first-child {
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }
  html:not(#_) .rp-root .rp-keys-balance-oled .km-bal-label {
    display: block !important;
    font-size: 0.58rem !important;
    font-weight: 750 !important;
    letter-spacing: 0.1em !important;
    text-transform: uppercase !important;
    color: var(--km-muted) !important;
    margin: 0 0 2px !important;
    line-height: 1.2 !important;
  }
  html:not(#_) .rp-root .rp-keys-balance-oled .km-bal-value {
    display: block !important;
    font-size: 1.22rem !important;
    font-weight: 720 !important;
    letter-spacing: -0.03em !important;
    color: #fff !important;
    line-height: 1.15 !important;
  }
  html:not(#_) .rp-root .rp-keys-balance-oled .km-bal-sub {
    display: block !important;
    margin-top: 2px !important;
    font-size: 0.68rem !important;
    color: var(--km-muted) !important;
    line-height: 1.25 !important;
  }
  html:not(#_) .rp-root .rp-keys-balance-oled .km-oled-gen,
  html:not(#_) .rp-root .rp-keys-balance-oled .rp-btn-generate {
    flex: 0 0 auto !important;
    margin-left: auto !important;
    min-height: 40px !important;
    height: 40px !important;
    padding: 0 14px !important;
    border-radius: 999px !important;
    background: #fff !important;
    color: #0a0a0c !important;
    border: 0 !important;
    box-shadow: none !important;
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.01em !important;
    white-space: nowrap !important;
  }

  /* ── KPI strip: compact 2×2 ── */
  html:not(#_) .rp-root .rp-keys-manager .rp-pro-kpi.rp-keys-kpi,
  html:not(#_) .rp-root .rp-keys-manager .rp-keys-kpi.rp-pro-kpi,
  html:not(#_) .rp-root .rp-keys-oled .rp-pro-kpi.rp-keys-kpi,
  html:not(#_) .va-shell--portal .rp-keys-kpi.rp-pro-kpi {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  html:not(#_) .rp-root .rp-keys-manager .rp-pro-kpi-card,
  html:not(#_) .rp-root .rp-keys-oled .rp-pro-kpi-card,
  html:not(#_) .va-shell--portal .rp-keys-kpi .rp-pro-kpi-card {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    gap: 2px !important;
    min-height: 58px !important;
    padding: 10px 12px !important;
    border-radius: 12px !important;
    background: var(--km-card) !important;
    border: 1px solid var(--km-border) !important;
    box-shadow: none !important;
  }
  html:not(#_) .rp-root .rp-keys-manager .rp-pro-kpi-top,
  html:not(#_) .rp-root .rp-keys-oled .rp-pro-kpi-top {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin: 0 !important;
  }
  html:not(#_) .rp-root .rp-keys-manager .rp-pro-kpi-ico,
  html:not(#_) .rp-root .rp-keys-manager .rp-pro-kpi-sub,
  html:not(#_) .rp-root .rp-keys-manager .rp-pro-spark,
  html:not(#_) .rp-root .rp-keys-oled .rp-pro-kpi-ico,
  html:not(#_) .rp-root .rp-keys-oled .rp-pro-kpi-sub,
  html:not(#_) .rp-root .rp-keys-oled .rp-pro-spark {
    display: none !important;
  }
  html:not(#_) .rp-root .rp-keys-manager .rp-pro-kpi-label,
  html:not(#_) .rp-root .rp-keys-oled .rp-pro-kpi-label {
    font-size: 0.58rem !important;
    font-weight: 750 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
    color: var(--km-muted) !important;
    margin: 0 !important;
  }
  html:not(#_) .rp-root .rp-keys-manager .rp-pro-kpi-value,
  html:not(#_) .rp-root .rp-keys-oled .rp-pro-kpi-value {
    font-size: 1.15rem !important;
    font-weight: 720 !important;
    letter-spacing: -0.03em !important;
    color: #fff !important;
    line-height: 1.1 !important;
    margin: 0 !important;
  }
  html:not(#_) .rp-root .rp-keys-manager .rp-pro-kpi-card--used .rp-pro-kpi-value,
  html:not(#_) .rp-root .rp-keys-oled .rp-pro-kpi-card--used .rp-pro-kpi-value {
    color: var(--km-emerald) !important;
  }

  /* ── Filters panel ── */
  html:not(#_) .rp-root .rp-keys-manager .rp-keys-panel.rp-card,
  html:not(#_) .rp-root .rp-keys-oled .rp-keys-panel.rp-card,
  html:not(#_) .rp-root .rp-keys-manager .rp-pro-panel {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    overflow: visible !important;
  }
  html:not(#_) .rp-root .rp-keys-manager .rp-pro-toolbar,
  html:not(#_) .rp-root .rp-keys-manager .rp-table-head.rp-pro-toolbar,
  html:not(#_) .rp-root .rp-keys-oled .rp-pro-toolbar {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    margin: 0 0 8px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
  }
  html:not(#_) .rp-root .rp-keys-manager .rp-pro-search,
  html:not(#_) .rp-root .rp-keys-oled .rp-pro-search,
  html:not(#_) .rp-root .rp-keys-panel .rp-pro-search {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    min-height: 44px !important;
    padding: 0 !important;
    border-radius: 12px !important;
    background: var(--km-card) !important;
    border: 1px solid var(--km-border) !important;
    overflow: hidden !important;
  }
  html:not(#_) .rp-root .rp-keys-manager .rp-pro-search > .lni,
  html:not(#_) .rp-root .rp-keys-oled .rp-pro-search > .lni,
  html:not(#_) .rp-root .rp-keys-panel .rp-pro-search > .lni {
    position: absolute !important;
    left: 12px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 2 !important;
    color: var(--km-muted) !important;
    font-size: 0.95rem !important;
    pointer-events: none !important;
    margin: 0 !important;
  }
  html:not(#_) .rp-root .rp-keys-manager .rp-pro-search input,
  html:not(#_) .rp-root .rp-keys-oled .rp-pro-search input,
  html:not(#_) .rp-root .rp-keys-panel .rp-pro-search input {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 44px !important;
    min-height: 44px !important;
    border: 0 !important;
    background: transparent !important;
    color: #fff !important;
    font-size: 0.88rem !important;
    font-weight: 500 !important;
    outline: none !important;
    /* leave room for the absolute search icon */
    padding: 0 12px 0 38px !important;
    box-shadow: none !important;
    line-height: 44px !important;
  }
  html:not(#_) .rp-root .rp-keys-manager .rp-pro-search input::placeholder,
  html:not(#_) .rp-root .rp-keys-panel .rp-pro-search input::placeholder {
    color: #737373 !important;
    opacity: 1 !important;
  }
  html:not(#_) .rp-root .rp-keys-manager .rp-pro-filters,
  html:not(#_) .rp-root .rp-keys-oled .rp-pro-filters {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  /* Search runs as you type — hide the broken extra icon button */
  html:not(#_) .rp-root .rp-keys-manager .rp-pro-search-btn {
    display: none !important;
  }
  html:not(#_) .rp-root .rp-keys-manager .rp-pro-select-wrap,
  html:not(#_) .rp-root .rp-keys-oled .rp-pro-select-wrap {
    min-width: 0 !important;
    width: 100% !important;
  }
  html:not(#_) .rp-root .rp-keys-manager .rp-pro-select-wrap .rp-bw-select,
  html:not(#_) .rp-root .rp-keys-manager .rp-pro-select-wrap button,
  html:not(#_) .rp-root .rp-keys-manager .rp-pro-select-wrap select {
    width: 100% !important;
    min-height: 40px !important;
    border-radius: 11px !important;
    font-size: 0.78rem !important;
    font-weight: 650 !important;
    background: var(--km-card) !important;
    border-color: var(--km-border) !important;
  }
  html:not(#_) .rp-root .rp-keys-manager .km-gen-bar {
    justify-content: flex-end !important;
    padding: 8px 10px !important;
    background: var(--km-card) !important;
  }
  html:not(#_) .rp-root .rp-keys-manager .km-gen-bar .km-oled-gen {
    margin-left: auto !important;
  }

  /* ── Bulk bar (compact — no per-card checkboxes on mobile) ── */
  html:not(#_) .rp-root .rp-keys-manager .rp-bulk-bar {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 0 0 8px !important;
    padding: 6px 10px !important;
    border-radius: 10px !important;
    background: transparent !important;
    border: 1px solid var(--km-border) !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 20 !important;
  }
  html:not(#_) .rp-root .rp-keys-manager .rp-bulk-select {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-size: 0.78rem !important;
    color: var(--km-dim) !important;
    font-weight: 550 !important;
    margin: 0 !important;
  }
  html:not(#_) .rp-root .rp-keys-manager .rp-bulk-select input {
    width: 16px !important;
    height: 16px !important;
    accent-color: #e5e7eb !important;
  }
  html:not(#_) .rp-root .rp-keys-manager .rp-bulk-actions {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 6px !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    width: 100% !important;
    padding-bottom: 2px !important;
  }
  html:not(#_) .rp-root .rp-keys-manager .rp-bulk-actions::-webkit-scrollbar {
    display: none !important;
  }
  html:not(#_) .rp-root .rp-keys-manager .rp-bulk-actions .rp-btn,
  html:not(#_) .rp-root .rp-keys-manager .rp-bulk-act,
  html:not(#_) .rp-root .rp-keys-manager .rp-bulk-del {
    flex: 0 0 auto !important;
    min-height: 34px !important;
    padding: 0 10px !important;
    border-radius: 9px !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
  }

  /* ── Key cards list ── */
  html:not(#_) .rp-root .rp-keys-manager .rp-key-cards.rp-mobile-only,
  html:not(#_) .rp-root .rp-keys-oled .rp-key-cards.rp-mobile-only {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
  }
  html:not(#_) .rp-root .rp-keys-manager .rp-table-wrap.rp-desktop-only,
  html:not(#_) .rp-root .rp-keys-oled .rp-table-wrap.rp-desktop-only {
    display: none !important;
  }

  html:not(#_) .rp-root .rp-keys-manager .rp-key-card,
  html:not(#_) .rp-root .rp-keys-oled .rp-key-card,
  html:not(#_) .rp-root .rp-keys-manager .km-m-card {
    display: grid !important;
    gap: 8px !important;
    padding: 11px 11px 10px !important;
    border-radius: 14px !important;
    background: var(--km-card) !important;
    border: 1px solid var(--km-border) !important;
    box-shadow: none !important;
    margin: 0 !important;
    min-width: 0 !important;
    transition: border-color 0.15s ease, background 0.15s ease;
  }
  html:not(#_) .rp-root .rp-keys-manager .rp-key-card.is-selected,
  html:not(#_) .rp-root .rp-keys-manager .km-m-card.is-selected {
    border-color: #2a2a2a !important;
    background: #0c0c0c !important;
  }

  /* Top row */
  html:not(#_) .rp-root .rp-keys-manager .km-m-card-top,
  html:not(#_) .rp-root .rp-keys-manager .km-oled-card-row {
    display: grid !important;
    grid-template-columns: 18px minmax(0, 1fr) 32px auto 28px !important;
    align-items: center !important;
    gap: 4px 6px !important;
    margin: 0 !important;
    min-width: 0 !important;
  }
  html:not(#_) .rp-root .rp-keys-manager .km-m-card-top.km-m-card-top--nocheck,
  html:not(#_) .rp-root .rp-keys-manager .km-oled-card-row.km-m-card-top--nocheck {
    grid-template-columns: minmax(0, 1fr) 32px auto 28px !important;
  }
  html:not(#_) .rp-root .rp-keys-manager .km-m-card-top input[type="checkbox"],
  html:not(#_) .rp-root .rp-keys-manager .km-oled-card-row input[type="checkbox"] {
    width: 16px !important;
    height: 16px !important;
    margin: 0 !important;
    accent-color: #e5e7eb !important;
  }
  html:not(#_) .rp-root .rp-keys-manager .km-m-key,
  html:not(#_) .rp-root .rp-keys-manager .km-oled-key,
  html:not(#_) .rp-root .rp-keys-manager .rp-key-card-top .rp-key-text {
    min-width: 0 !important;
    max-width: 100% !important;
    border: 0 !important;
    background: none !important;
    color: #fff !important;
    font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace !important;
    font-size: 0.74rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.015em !important;
    text-align: left !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    cursor: pointer !important;
    padding: 0 !important;
    line-height: 1.25 !important;
  }
  html:not(#_) .rp-root .rp-keys-manager .km-m-copy,
  html:not(#_) .rp-root .rp-keys-manager .km-oled-copy {
    width: 32px !important;
    height: 32px !important;
    border: 0 !important;
    border-radius: 9px !important;
    background: transparent !important;
    color: #9ca3af !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1rem !important;
    padding: 0 !important;
  }
  html:not(#_) .rp-root .rp-keys-manager .km-m-status,
  html:not(#_) .rp-root .rp-keys-manager .km-oled-status,
  html:not(#_) .rp-root .rp-keys-manager .km-status-pill {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    min-height: 22px !important;
    padding: 0 8px !important;
    border-radius: 999px !important;
    font-size: 0.62rem !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
    border: 0 !important;
  }
  html:not(#_) .rp-root .rp-keys-manager .km-m-status i,
  html:not(#_) .rp-root .rp-keys-manager .km-oled-status i,
  html:not(#_) .rp-root .rp-keys-manager .km-status-pill i {
    width: 5px !important;
    height: 5px !important;
    border-radius: 999px !important;
    background: currentColor !important;
    display: inline-block !important;
  }
  html:not(#_) .rp-root .rp-keys-manager .km-status-pill.is-used,
  html:not(#_) .rp-root .rp-keys-manager .km-oled-status.is-used,
  html:not(#_) .rp-root .rp-keys-manager .km-m-status.is-used,
  html:not(#_) .rp-root .rp-keys-oled .km-status-pill.is-used,
  html:not(#_) .rp-root .rp-keys-oled .km-oled-status.is-used {
    color: #34d399 !important;
    background: rgba(16, 185, 129, 0.16) !important;
  }
  html:not(#_) .rp-root .rp-keys-manager .km-status-pill.is-unused,
  html:not(#_) .rp-root .rp-keys-manager .km-oled-status.is-unused,
  html:not(#_) .rp-root .rp-keys-manager .km-m-status.is-unused,
  html:not(#_) .rp-root .rp-keys-oled .km-status-pill.is-unused,
  html:not(#_) .rp-root .rp-keys-oled .km-oled-status.is-unused {
    color: #9ca3af !important;
    background: rgba(156, 163, 175, 0.16) !important;
  }
  html:not(#_) .rp-root .rp-keys-manager .km-status-pill.is-unlinked,
  html:not(#_) .rp-root .rp-keys-manager .km-m-status.is-unlinked,
  html:not(#_) .rp-root .rp-keys-oled .km-status-pill.is-unlinked {
    color: #fbbf24 !important;
    background: rgba(245, 158, 11, 0.16) !important;
  }
  html:not(#_) .rp-root .rp-keys-manager .km-status-pill.is-expired,
  html:not(#_) .rp-root .rp-keys-manager .km-oled-status.is-expired,
  html:not(#_) .rp-root .rp-keys-manager .km-m-status.is-expired,
  html:not(#_) .rp-root .rp-keys-manager .km-status-pill.is-banned,
  html:not(#_) .rp-root .rp-keys-manager .km-oled-status.is-banned,
  html:not(#_) .rp-root .rp-keys-manager .km-m-status.is-banned,
  html:not(#_) .rp-root .rp-keys-oled .km-status-pill.is-expired,
  html:not(#_) .rp-root .rp-keys-oled .km-oled-status.is-expired,
  html:not(#_) .rp-root .rp-keys-oled .km-status-pill.is-banned,
  html:not(#_) .rp-root .rp-keys-oled .km-oled-status.is-banned {
    color: #f87171 !important;
    background: rgba(239, 68, 68, 0.16) !important;
  }
  html:not(#_) .rp-root .rp-keys-manager .rp-dots-wrap,
  html:not(#_) .rp-root .rp-keys-manager .rp-dots {
    width: 28px !important;
    min-width: 28px !important;
    height: 32px !important;
    justify-self: end !important;
  }
  html:not(#_) .rp-root .rp-keys-manager .rp-dots {
    display: inline-flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    border: 0 !important;
    background: transparent !important;
    padding: 0 !important;
    color: #9ca3af !important;
  }
  html:not(#_) .rp-root .rp-keys-manager .rp-dots span {
    width: 3px !important;
    height: 3px !important;
    border-radius: 999px !important;
    background: currentColor !important;
    display: block !important;
  }

  /* Middle */
  html:not(#_) .rp-root .rp-keys-manager .km-m-card-mid,
  html:not(#_) .rp-root .rp-keys-manager .km-oled-user {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 6px 8px !important;
    margin: 0 !important;
    min-width: 0 !important;
  }
  html:not(#_) .rp-root .rp-keys-manager .km-m-user,
  html:not(#_) .rp-root .rp-keys-manager .km-oled-user {
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px !important;
    min-width: 0 !important;
  }
  html:not(#_) .rp-root .rp-keys-manager .km-m-user .rp-avatar,
  html:not(#_) .rp-root .rp-keys-manager .km-oled-user .rp-avatar,
  html:not(#_) .rp-root .rp-keys-manager .km-oled-user-av {
    width: 20px !important;
    height: 20px !important;
    border-radius: 999px !important;
    object-fit: cover !important;
    flex: 0 0 auto !important;
  }
  html:not(#_) .rp-root .rp-keys-manager .km-m-user strong,
  html:not(#_) .rp-root .rp-keys-manager .km-oled-user strong {
    font-size: 0.8rem !important;
    font-weight: 650 !important;
    color: #e5e7eb !important;
    max-width: 120px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
  html:not(#_) .rp-root .rp-keys-manager .km-m-user em,
  html:not(#_) .rp-root .rp-keys-manager .km-oled-user em {
    font-style: normal !important;
    font-size: 0.58rem !important;
    font-weight: 700 !important;
    color: var(--km-muted) !important;
    border: 1px solid var(--km-border) !important;
    border-radius: 999px !important;
    padding: 2px 6px !important;
    background: #121212 !important;
    line-height: 1.1 !important;
  }
  html:not(#_) .rp-root .rp-keys-manager .km-m-meta,
  html:not(#_) .rp-root .rp-keys-manager .km-oled-meta,
  html:not(#_) .rp-root .rp-keys-manager .km-oled-submeta {
    margin: 0 !important;
    color: var(--km-muted) !important;
    font-size: 0.7rem !important;
    font-weight: 500 !important;
    line-height: 1.35 !important;
    min-width: 0 !important;
    overflow-wrap: anywhere !important;
  }
  html:not(#_) .rp-root .rp-keys-manager .km-oled-submeta {
    margin-top: -2px !important;
  }

  /* Bottom */
  html:not(#_) .rp-root .rp-keys-manager .km-m-card-bot,
  html:not(#_) .rp-root .rp-keys-manager .km-oled-date {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    margin: 0 !important;
    padding-top: 7px !important;
    border-top: 1px solid var(--km-border-soft) !important;
    color: var(--km-muted) !important;
    font-size: 0.66rem !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
  }
  html:not(#_) .rp-root .rp-keys-manager .km-m-card-bot .lni,
  html:not(#_) .rp-root .rp-keys-manager .km-oled-date .lni {
    font-size: 0.72rem !important;
    opacity: 0.85 !important;
  }

  /* Empty / pager */
  html:not(#_) .rp-root .rp-keys-manager .rp-keys-empty {
    padding: 28px 12px !important;
    text-align: center !important;
  }
  html:not(#_) .rp-root .rp-keys-manager .rp-pro-pager {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    margin-top: 10px !important;
    padding: 10px !important;
    border-radius: 12px !important;
    background: var(--km-card) !important;
    border: 1px solid var(--km-border) !important;
    font-size: 0.74rem !important;
    color: var(--km-dim) !important;
  }
  html:not(#_) .rp-root .rp-keys-manager .rp-pro-pager .rp-bulk-actions {
    width: 100% !important;
    justify-content: space-between !important;
  }

  /* Compact anchored actions menu next to ⋮ */
  html:not(#_) .rp-actions-panel--anchor {
    width: min(220px, calc(100vw - 16px)) !important;
    max-height: min(70vh, 360px) !important;
    overflow: auto !important;
    border-radius: 12px !important;
    background: #0e0e0e !important;
    border: 1px solid #222222 !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55) !important;
  }
  html:not(#_) .rp-actions-panel--anchor .rp-actions-panel-item {
    min-height: 42px !important;
    font-size: 0.86rem !important;
  }
}


/* ── Admin Resellers tab — premium mobile cards ── */
@media (max-width: 900px), ((hover: none) and (pointer: coarse)) {
  html:not(#_) .rp-root.rp-resellers-oled-active .rp-toolbar h1 {
    font-size: 1.55rem !important;
    font-weight: 720 !important;
    letter-spacing: -0.035em !important;
    color: #fff !important;
  }
  html:not(#_) .rp-root.rp-resellers-oled-active .rp-toolbar .rp-hint {
    display: block !important;
    margin-top: 0.2rem !important;
    font-size: 0.78rem !important;
    color: #a3a3a3 !important;
  }
  html:not(#_) .rp-root.rp-resellers-oled-active .rp-toolbar-actions .rp-cta-blacklight {
    min-height: 40px !important;
    padding: 0 14px !important;
    border-radius: 999px !important;
    font-size: 0.78rem !important;
  }

  html:not(#_) .rp-root .rp-resellers-oled.rp-resellers-panel,
  html:not(#_) .rp-root .rp-resellers-oled.rp-card {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
  }
  html:not(#_) .rp-root .rp-resellers-oled .rp-resellers-toolbar {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    margin: 0 0 10px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
  }
  html:not(#_) .rp-root .rp-resellers-oled .rp-resellers-legend {
    display: none !important;
  }
  html:not(#_) .rp-root .rp-resellers-oled .rp-resellers-search {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    border-radius: 12px !important;
    background: #1c1c1c !important;
    border: 1px solid #2e2e2e !important;
    overflow: hidden !important;
  }
  html:not(#_) .rp-root .rp-resellers-oled .rp-resellers-search > .lni {
    position: absolute !important;
    left: 12px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 2 !important;
    color: #a3a3a3 !important;
    pointer-events: none !important;
  }
  html:not(#_) .rp-root .rp-resellers-oled .rp-resellers-search input {
    display: block !important;
    width: 100% !important;
    min-height: 44px !important;
    height: 44px !important;
    padding: 0 12px 0 38px !important;
    border: 0 !important;
    background: transparent !important;
    color: #fff !important;
    font-size: 0.88rem !important;
    font-weight: 500 !important;
    box-shadow: none !important;
  }
  html:not(#_) .rp-root .rp-resellers-oled .rp-resellers-search input::placeholder {
    color: #737373 !important;
  }

  html:not(#_) .rp-root .rp-resellers-oled .rp-resellers-wrap {
    display: block !important;
    overflow: visible !important;
    width: 100% !important;
  }
  html:not(#_) .rp-root .rp-resellers-oled .rp-resellers-table,
  html:not(#_) .rp-root .rp-resellers-oled .rp-resellers-table thead,
  html:not(#_) .rp-root .rp-resellers-oled .rp-resellers-table tbody,
  html:not(#_) .rp-root .rp-resellers-oled .rp-resellers-table tr,
  html:not(#_) .rp-root .rp-resellers-oled .rp-resellers-table th,
  html:not(#_) .rp-root .rp-resellers-oled .rp-resellers-table td {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
  html:not(#_) .rp-root .rp-resellers-oled .rp-resellers-table thead {
    display: none !important;
  }
  html:not(#_) .rp-root .rp-resellers-oled .rp-resellers-table tbody {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
  }
  html:not(#_) .rp-root .rp-resellers-oled .rp-resellers-table tbody tr {
    position: relative !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    margin: 0 !important;
    padding: 12px !important;
    border-radius: 14px !important;
    background: #1c1c1c !important;
    border: 1px solid #2e2e2e !important;
    box-shadow: none !important;
  }
  html:not(#_) .rp-root .rp-resellers-oled .rp-resellers-table tbody td {
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  /* Header: avatar + name */
  html:not(#_) .rp-root .rp-resellers-oled .rp-resellers-table tbody td:nth-child(1) {
    grid-column: 1 / -1 !important;
    padding-right: 4.8rem !important;
  }
  html:not(#_) .rp-root .rp-resellers-oled .rp-user-cell {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    max-width: 100% !important;
  }
  html:not(#_) .rp-root .rp-resellers-oled .rp-avatar {
    width: 40px !important;
    height: 40px !important;
    border-radius: 999px !important;
    border: 1px solid #333 !important;
  }
  html:not(#_) .rp-root .rp-resellers-oled .rp-user-meta strong {
    display: block !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    color: #fff !important;
    letter-spacing: -0.02em !important;
  }
  html:not(#_) .rp-root .rp-resellers-oled .rp-user-meta > .rp-muted {
    display: block !important;
    font-size: 0.7rem !important;
    color: #737373 !important;
    max-width: 100% !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  /* Role + status chips */
  html:not(#_) .rp-root .rp-resellers-oled .rp-resellers-table tbody td:nth-child(2) {
    grid-column: 1 / 2 !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
  }
  html:not(#_) .rp-root .rp-resellers-oled .rp-resellers-table tbody td:nth-child(11) {
    grid-column: 2 / 3 !important;
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
  }
  html:not(#_) .rp-root .rp-resellers-oled .rp-pill {
    font-size: 0.62rem !important;
    font-weight: 700 !important;
    padding: 0.22rem 0.5rem !important;
    border-radius: 999px !important;
  }

  /* Products */
  html:not(#_) .rp-root .rp-resellers-oled .rp-resellers-table tbody td:nth-child(3) {
    grid-column: 1 / -1 !important;
  }
  html:not(#_) .rp-root .rp-resellers-oled .rp-prod-assign {
    display: inline-flex !important;
    flex-wrap: wrap !important;
    gap: 5px !important;
  }
  html:not(#_) .rp-root .rp-resellers-oled .rp-prod-mark {
    min-height: 24px !important;
    padding: 0 8px !important;
    border-radius: 8px !important;
    font-size: 0.62rem !important;
    font-weight: 700 !important;
    background: #141414 !important;
    border: 1px solid #2e2e2e !important;
    color: #737373 !important;
  }
  html:not(#_) .rp-root .rp-resellers-oled .rp-prod-mark.is-on {
    color: #fafafa !important;
    background: #222 !important;
    border-color: #3a3a3a !important;
  }

  /* Hide vintage / fluorite wallet cols (use combined balance) + hide proxy num? show IPA Proxy Flu Subs */
  html:not(#_) .rp-root .rp-resellers-oled .rp-resellers-table tbody td:nth-child(4),
  html:not(#_) .rp-root .rp-resellers-oled .rp-resellers-table tbody td:nth-child(5) {
    display: none !important;
  }
  html:not(#_) .rp-root .rp-resellers-oled .rp-resellers-table .rp-desktop-only {
    display: none !important;
  }
  html:not(#_) .rp-root .rp-resellers-oled .rp-resellers-table .rp-mobile-only {
    display: inline !important;
  }

  /* Stats 2×2: Balance · IPA · Fluorite · Subs (proxy folded into IPA label space — show proxy as 3rd) */
  html:not(#_) .rp-root .rp-resellers-oled .rp-resellers-table tbody td:nth-child(6),
  html:not(#_) .rp-root .rp-resellers-oled .rp-resellers-table tbody td:nth-child(7),
  html:not(#_) .rp-root .rp-resellers-oled .rp-resellers-table tbody td:nth-child(9),
  html:not(#_) .rp-root .rp-resellers-oled .rp-resellers-table tbody td:nth-child(10) {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    gap: 2px !important;
    min-height: 52px !important;
    padding: 8px 10px !important;
    border-radius: 11px !important;
    background: #141414 !important;
    border: 1px solid #2a2a2a !important;
    font-size: 0.95rem !important;
    font-weight: 720 !important;
    color: #fff !important;
    white-space: nowrap !important;
  }
  html:not(#_) .rp-root .rp-resellers-oled .rp-resellers-table tbody td:nth-child(8) {
    display: none !important; /* proxy count — keep card compact; products show Proxy badge */
  }
  html:not(#_) .rp-root .rp-resellers-oled .rp-resellers-table tbody td:nth-child(6)::before {
    content: "Balance";
    font-size: 0.58rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #737373;
  }
  html:not(#_) .rp-root .rp-resellers-oled .rp-resellers-table tbody td:nth-child(7)::before {
    content: "IPA keys";
    font-size: 0.58rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #737373;
  }
  html:not(#_) .rp-root .rp-resellers-oled .rp-resellers-table tbody td:nth-child(9)::before {
    content: "Fluorite";
    font-size: 0.58rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #737373;
  }
  html:not(#_) .rp-root .rp-resellers-oled .rp-resellers-table tbody td:nth-child(10)::before {
    content: "Subs";
    font-size: 0.58rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #737373;
  }
  html:not(#_) .rp-root .rp-resellers-oled .rp-shared-on {
    margin-left: 6px !important;
    font-size: 0.58rem !important;
    vertical-align: middle !important;
  }
  html:not(#_) .rp-root .rp-resellers-oled .rp-bal-combined {
    color: #fff !important;
    font-weight: 720 !important;
  }

  /* Manage button */
  html:not(#_) .rp-root .rp-resellers-oled .rp-resellers-table tbody td.rp-td-actions,
  html:not(#_) .rp-root .rp-resellers-oled .rp-resellers-table tbody td:nth-child(12) {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    width: auto !important;
    z-index: 2 !important;
  }
  html:not(#_) .rp-root .rp-resellers-oled .va-actions-btn {
    min-height: 34px !important;
    padding: 0 10px !important;
    border-radius: 9px !important;
    border: 1px solid #2e2e2e !important;
    background: #141414 !important;
    color: #e5e5e5 !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    gap: 5px !important;
  }
  html:not(#_) .rp-root .rp-resellers-oled .va-actions-btn .lni {
    font-size: 0.85rem !important;
  }
}

/* Mobile portal titles — Home / Keys / Team / Logs sync */
@media (max-width: 900px), ((hover: none) and (pointer: coarse)) {
  html:not(#_) .va-shell--portal .rp-root .rp-toolbar {
    margin-bottom: 0.65rem !important;
  }
  html:not(#_) .va-shell--portal .rp-root .rp-toolbar h1 {
    font-size: 1.55rem !important;
    font-weight: 720 !important;
    letter-spacing: -0.035em !important;
    color: #fff !important;
  }
  html:not(#_) .va-shell--portal .rp-root .rp-toolbar .rp-hint {
    display: block !important;
    margin-top: 0.2rem !important;
    font-size: 0.78rem !important;
    color: #a3a3a3 !important;
  }
  html:not(#_) .va-shell--portal .va-main-scroll,
  html:not(#_) .va-shell--portal .va-page {
    background: #121212 !important;
  }
  /* Keys Manager tab sits a little blacker than Home / other pages */
  html:not(#_) .va-shell--portal:has(.rp-keys-oled-active) .va-main-scroll,
  html:not(#_) .va-shell--portal:has(.rp-keys-oled-active) .va-page,
  html:not(#_) .va-shell--portal:has(.rp-keys-manager) .va-main-scroll,
  html:not(#_) .va-shell--portal:has(.rp-keys-manager) .va-page,
  html:not(#_) .va-shell--portal:has(.rp-keys-oled-active) .va-mobile-top,
  html:not(#_) .va-shell--portal:has(.rp-keys-manager) .va-mobile-top {
    background: #070707 !important;
  }
}


/* Narrow phones: slightly tighter type */
@media (max-width: 360px), ((hover: none) and (pointer: coarse) and (max-width: 360px)) {
  html:not(#_) .rp-root .rp-keys-balance-oled .km-bal-value {
    font-size: 1.1rem !important;
  }
  html:not(#_) .rp-root .rp-keys-manager .km-m-key,
  html:not(#_) .rp-root .rp-keys-manager .km-oled-key {
    font-size: 0.68rem !important;
  }
  html:not(#_) .rp-root .rp-keys-balance-oled .km-oled-gen {
    padding: 0 11px !important;
    font-size: 0.72rem !important;
  }
}

@media (hover: hover) and (pointer: fine) and (min-width: 901px) {
  .km-oled-page-frame {
    min-height: 100vh;
    display: grid;
    place-items: start center;
    background: #050507;
    padding: 24px 12px;
  }
  /* Desktop: never force mobile sheet */
  .rp-actions-panel--sheet {
    /* noop fallback if class somehow applied */
  }
}

@keyframes kmSheetUp {
  from { transform: translateY(16px); opacity: 0.7; }
  to { transform: translateY(0); opacity: 1; }
}
