/* LookupHub — Premium dark theme design system */

:root {
  --bg-base: #0A0B14;
  --surface: #13151F;
  --surface-elevated: #1A1D2B;
  --border: #252836;
  --text-primary: #F4F5FA;
  --text-secondary: #8B8FA3;
  --text-muted: #5A5E72;
  --accent-reverse: #3B82F6;
  --accent-reverse-light: #60A5FA;
  --accent-ssn: #A855F7;
  --accent-ssn-light: #C084FC;
  --accent-scoring: #10B981;
  --accent-scoring-light: #34D399;
  --accent-billing: #F59E0B;
  --accent-billing-light: #FBBF24;
  --accent-danger: #EF4444;
  --accent-danger-light: #F87171;
  --sidebar-width: 240px;
  --topbar-height: 64px;
  --scrollbar-size: 6px;
  --scrollbar-track: rgba(10, 11, 20, 0.85);
  --scrollbar-thumb: rgba(71, 85, 105, 0.75);
  --scrollbar-thumb-hover: rgba(52, 211, 153, 0.55);
  --scrollbar-thumb-active: rgba(16, 185, 129, 0.7);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  color-scheme: dark;
}

/* Custom scrollbars — all scrollable areas (WebKit + Firefox) */
html,
body,
* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

*::-webkit-scrollbar {
  width: var(--scrollbar-size);
  height: var(--scrollbar-size);
}

*::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(
    180deg,
    rgba(100, 116, 139, 0.65) 0%,
    rgba(71, 85, 105, 0.85) 100%
  );
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.5);
  min-height: 24px;
  min-width: 24px;
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(
    180deg,
    rgba(52, 211, 153, 0.5) 0%,
    rgba(16, 185, 129, 0.65) 100%
  );
  border-color: rgba(52, 211, 153, 0.25);
}

*::-webkit-scrollbar-thumb:active {
  background: var(--scrollbar-thumb-active);
}

*::-webkit-scrollbar-button,
*::-webkit-scrollbar-button:single-button,
*::-webkit-scrollbar-button:vertical:start:decrement,
*::-webkit-scrollbar-button:vertical:end:increment,
*::-webkit-scrollbar-button:horizontal:start:decrement,
*::-webkit-scrollbar-button:horizontal:end:increment {
  display: none;
  width: 0;
  height: 0;
}

*::-webkit-scrollbar-corner {
  background: var(--scrollbar-track);
}

/* Layout */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 35;
}

.main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-height);
  min-height: var(--topbar-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
}

.main-content {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
}

.card-glow-reverse { box-shadow: 0 0 40px rgba(59, 130, 246, 0.15); }
.card-glow-ssn { box-shadow: 0 0 40px rgba(168, 85, 247, 0.15); }

.ssn-results__count { font-size: 0.95rem; }
.ssn-results-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: min(70vh, 520px);
  overflow-y: auto;
  padding-right: 2px;
}
.ssn-result-item {
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  background: rgba(168, 85, 247, 0.06);
}
.ssn-result-item__head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  flex-wrap: wrap;
}
.ssn-result-item__actions {
  display: flex;
  gap: 0.35rem;
  margin-left: auto;
}
.ssn-result-item__num {
  font-size: 0.7rem;
  color: var(--text-muted, #94a3b8);
  font-weight: 600;
}
.ssn-result-item__name {
  font-weight: 600;
  font-size: 0.9rem;
  margin: 0;
  color: var(--text-primary, #f1f5f9);
}
.ssn-result-item__ssn {
  font-size: 1.35rem;
  font-weight: 700;
  color: #c084fc;
  margin: 0.25rem 0 0.5rem;
  letter-spacing: 0.04em;
}
.ssn-result-item__meta {
  font-size: 0.78rem;
  margin: 0.2rem 0;
  line-height: 1.35;
  color: var(--text-secondary, #cbd5e1);
}
.ssn-result-item__meta.text-muted { color: var(--text-muted, #94a3b8); }
.ssn-result-item__meta i { margin-right: 0.25rem; opacity: 0.85; }
.ssn-result-item__badge {
  font-size: 0.65rem;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  background: rgba(168, 85, 247, 0.2);
  color: #d8b4fe;
  margin-left: auto;
  white-space: nowrap;
}
.ssn-result-item__block { margin-top: 0.55rem; }
.ssn-result-item__label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #94a3b8);
  margin: 0 0 0.25rem;
  font-weight: 600;
}
.ssn-result-item__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ssn-result-item__list li {
  font-size: 0.78rem;
  line-height: 1.4;
  margin: 0.2rem 0;
  color: var(--text-secondary, #cbd5e1);
}
.ssn-result-item__list li i { margin-right: 0.3rem; opacity: 0.8; vertical-align: -1px; }
.ssn-results__raw { display: inline; }
.ssn-results__warn {
  font-size: 0.78rem;
  line-height: 1.4;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.75rem;
}
.ssn-results__warn i { margin-right: 0.35rem; vertical-align: -2px; }
.ssn-results__warn--info {
  color: #a78bfa;
  background: rgba(168, 85, 247, 0.08);
  border-color: rgba(168, 85, 247, 0.25);
}
.card-glow-scoring { box-shadow: 0 0 40px rgba(16, 185, 129, 0.15); }
.card-glow-billing { box-shadow: 0 0 40px rgba(245, 158, 11, 0.15); }
.card-glow-admin { box-shadow: 0 0 40px rgba(239, 68, 68, 0.12); }

.btn-gradient-admin {
  background: linear-gradient(135deg, #ef4444, #f87171);
  color: #fff;
  border: none;
}
.btn-gradient-admin:hover { filter: brightness(1.08); }

/* Gradient text */
.gradient-text-reverse {
  background: linear-gradient(90deg, var(--accent-reverse), var(--accent-reverse-light));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.gradient-text-ssn {
  background: linear-gradient(90deg, var(--accent-ssn), var(--accent-ssn-light));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.gradient-text-scoring {
  background: linear-gradient(90deg, var(--accent-scoring), var(--accent-scoring-light));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.gradient-text-billing {
  background: linear-gradient(90deg, var(--accent-billing), var(--accent-billing-light));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.gradient-text-admin {
  background: linear-gradient(90deg, #ef4444, #fca5a5);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.admin-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  flex-shrink: 0;
}
.admin-identity-key { font-family: ui-monospace, Consolas, monospace; font-size: 0.75rem; color: var(--text-muted); }
.badge-api-on {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 600;
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}
.badge-api-off {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.65rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
}

.admin-tool-tab {
  padding: 0.5rem 1rem;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
}
.admin-tool-tab.active {
  border-color: rgba(239, 68, 68, 0.5);
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.12);
}
.admin-tech-log {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.7rem;
  line-height: 1.45;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem;
  overflow: auto;
  max-height: 320px;
  white-space: pre-wrap;
  word-break: break-word;
  color: #a3e635;
}
.admin-service-pill {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  font-size: 0.75rem;
}
.admin-service-pill.ok { border-color: rgba(34, 197, 94, 0.4); }
.admin-service-pill.bad { border-color: rgba(239, 68, 68, 0.45); background: rgba(239, 68, 68, 0.08); }

.admin-secret-reveal {
  margin-top: 0.5rem;
  padding: 0;
  border-radius: 10px;
  background: transparent;
  border: none;
}
.admin-secret-reveal-inner {
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(245, 158, 11, 0.45);
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.12);
}
.admin-secret-reveal-title {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  color: #fcd34d;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.admin-secret-reveal-value {
  display: block;
  font-size: 0.95rem;
  word-break: break-all;
  color: #fde68a;
  margin: 0 0 0.65rem;
  padding: 0.5rem 0.55rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  user-select: all;
  -webkit-user-select: all;
}
.admin-secret-reveal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.admin-secret-copy-btn {
  flex: 1;
  min-width: 7rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.15);
  color: #fde68a;
}
.admin-secret-dismiss-btn {
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  font-size: 0.78rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: var(--text-muted, #94a3b8);
}
.admin-secret-reveal code {
  display: block;
  font-size: 0.8rem;
  word-break: break-all;
  color: #fde68a;
  margin-bottom: 0.5rem;
}
.btn-copy-inline {
  font-size: 0.7rem;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
}
.btn-copy-inline:hover { color: #fff; border-color: rgba(239, 68, 68, 0.4); }

.auth-tg-loading {
  text-align: center;
  padding: 1.25rem 0.5rem 1rem;
}
.auth-tg-hint {
  text-align: center;
  line-height: 1.4;
}
body.auth-tma-mode .auth-tab[data-auth-tab="login"].hidden {
  display: none;
}
body.auth-tma-mode #btn-auth-show-key-login {
  display: block;
  width: 100%;
  margin-bottom: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted, #94a3b8);
  text-decoration: underline;
  background: none;
  border: none;
  cursor: pointer;
}

/* Admin user workspace */
.admin-user-hub-root { min-height: 200px; }
.admin-hub { display: flex; flex-direction: column; gap: 1rem; }
.admin-hub-top { display: flex; flex-direction: column; gap: 0.75rem; }
.admin-hub-back {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.admin-hub-back:hover { color: #fff; border-color: rgba(239, 68, 68, 0.45); }
.admin-hub-identity {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1rem 1.1rem;
}
.admin-hub-name { font-size: 1.25rem; font-weight: 700; margin: 0 0 0.25rem; }
.admin-hub-sub { font-size: 0.8rem; color: var(--text-muted); margin: 0; }
.admin-hub-id { margin: 0.35rem 0 0; }
.admin-hub-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(88px, 1fr));
  gap: 0.65rem;
}
@media (min-width: 640px) {
  .admin-hub-kpis { grid-template-columns: repeat(4, minmax(88px, 1fr)); }
}
.admin-hub-kpi {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
}
.admin-hub-tabs {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: thin;
}
.admin-hub-tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  font-size: 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  white-space: nowrap;
}
.admin-hub-tab--active {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.12);
  color: #fecaca;
}
.admin-hub-panel { min-height: 120px; }
.admin-hub-grid-2 {
  display: grid;
  gap: 1rem;
}
@media (min-width: 768px) {
  .admin-hub-grid-2 { grid-template-columns: 1fr 1fr; }
}
.admin-hub-card-title {
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.admin-hub-quick {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.admin-hub-quick-btn {
  justify-content: flex-start;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 0.8rem;
}
.admin-hub-activity-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.admin-hub-type {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  flex-shrink: 0;
}
.admin-hub-type--reverse { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
.admin-hub-type--ssn { background: rgba(168, 85, 247, 0.2); color: #d8b4fe; }
.admin-hub-type--scoring { background: rgba(34, 197, 94, 0.2); color: #86efac; }
.admin-hub-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
}
.admin-hub-pager-wrap {
  padding: 0.65rem 0.85rem;
  border-top: 1px solid var(--border);
}
.admin-hub-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.admin-hub-pager-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  min-width: 5rem;
  text-align: center;
}
.admin-hub-pager-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  color: #e2e8f0;
}
.admin-hub-pager-btn:hover:not(:disabled) {
  border-color: rgba(239, 68, 68, 0.45);
  color: #fecaca;
}
.admin-hub-pager-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.admin-hub-api-card { padding: 1rem 1.1rem; }
.admin-hub-api-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.admin-hub-api-status {
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
}
.admin-hub-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  flex-shrink: 0;
}
.admin-hub-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.admin-hub-switch-track {
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.45);
  border: 1px solid var(--border);
  position: relative;
  transition: background 0.2s ease;
}
.admin-hub-switch-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e2e8f0;
  transition: transform 0.2s ease;
}
.admin-hub-switch input:checked + .admin-hub-switch-track {
  background: rgba(34, 197, 94, 0.35);
  border-color: rgba(52, 211, 153, 0.5);
}
.admin-hub-switch input:checked + .admin-hub-switch-track::after {
  transform: translateX(20px);
  background: #6ee7b7;
}
.admin-hub-switch-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #94a3b8;
  min-width: 4.5rem;
}
.admin-hub-switch input:checked ~ .admin-hub-switch-label {
  color: #6ee7b7;
}
.admin-hub-lrow { cursor: pointer; }
.admin-hub-lrow:hover { background: rgba(255, 255, 255, 0.04); }
.admin-hub-console-grid {
  display: grid;
  gap: 1rem;
}
@media (min-width: 1024px) {
  .admin-hub-console-grid { grid-template-columns: 1fr 1fr; }
}
.admin-hub-console-filter {
  font-size: 0.7rem;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.admin-hub-console-filter.active {
  border-color: rgba(239, 68, 68, 0.45);
  color: #fecaca;
  background: rgba(239, 68, 68, 0.1);
}

/* Admin deposit wallets grid */
.admin-wallets-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .admin-wallets-grid { grid-template-columns: repeat(2, 1fr); }
}
.admin-wallet-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  background: rgba(0, 0, 0, 0.2);
}
.admin-wallet-card--off { opacity: 0.55; }
.admin-wallet-card-head {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
}
.admin-wallet-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  font-size: 1.1rem;
  flex-shrink: 0;
}
.admin-wallet-address { color: #e5e7eb; line-height: 1.35; }
.admin-wallet-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.65rem;
  flex-wrap: wrap;
}
.admin-wallet-toggle { margin-left: auto; flex-shrink: 0; }

.admin-crypto-slots .admin-crypto-row {
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(55, 65, 81, 0.5);
}
.admin-crypto-slots .admin-crypto-row:last-child { border-bottom: none; }
.admin-crypto-row-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #f3f4f6;
  margin-bottom: 0.35rem;
}
.admin-crypto-row-hint { font-size: 0.6875rem; color: #9ca3af; margin-bottom: 0.5rem; }
.admin-wallets-extra .admin-wallet-mini {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0;
  font-size: 0.75rem;
  border-top: 1px solid rgba(55, 65, 81, 0.35);
}

/* —— API page (user web) —— */
.api-page { display: flex; flex-direction: column; gap: 1.25rem; }
.api-page > .card,
.api-page > .api-key-panel { margin-bottom: 0; }
.api-page .is-hidden { display: none !important; }

.api-page-hero {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 4px 2px 8px;
}
.api-page-hero-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(168, 85, 247, 0.2));
  border: 1px solid rgba(96, 165, 250, 0.35);
  color: #93c5fd;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.api-page-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
}
.api-page-sub {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.45;
  max-width: 36rem;
}

.api-key-panel {
  border: 1px solid rgba(59, 130, 246, 0.28);
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.55), rgba(15, 23, 42, 0.65));
  box-shadow: 0 0 24px rgba(59, 130, 246, 0.08);
}
.api-key-panel-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.api-key-panel-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}
.api-key-panel-title { font-size: 0.9375rem; font-weight: 600; margin: 0 0 2px; }
.api-key-panel-hint { font-size: 0.75rem; color: var(--text-muted); margin: 0; }
.api-auth-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 8px;
  border-radius: 6px;
  flex-shrink: 0;
}
.api-auth-badge--key {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}
.api-auth-badge--session {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.35);
}
.api-key-field-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  margin-top: 14px;
}
.api-key-field {
  flex: 1;
  min-width: 0;
  font-size: 0.8125rem !important;
  padding: 10px 12px !important;
  background: rgba(0, 0, 0, 0.35) !important;
  border-color: rgba(55, 65, 81, 0.65) !important;
}
.api-key-icon-btn {
  width: 42px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(55, 65, 81, 0.65);
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.6);
  color: #e2e8f0;
  font-size: 1.1rem;
}
.api-key-icon-btn:hover {
  border-color: rgba(59, 130, 246, 0.5);
  color: #93c5fd;
}
.api-key-status {
  margin: 10px 0 0;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--text-muted);
}
.api-key-status--ok { color: #86efac; }
.api-key-status--warn { color: #fcd34d; }
.api-key-status--err { color: #fca5a5; }
.api-key-prefix {
  margin: 6px 0 0;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: ui-monospace, monospace;
}
.api-key-load {
  margin-top: 10px;
  width: 100%;
  font-size: 0.8125rem;
  border: 1px dashed rgba(59, 130, 246, 0.45);
  border-radius: 10px;
  padding: 10px;
  color: #93c5fd;
}

.api-playground-card {
  border: 1px solid rgba(55, 65, 81, 0.6);
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.4), rgba(15, 23, 42, 0.5));
  overflow: hidden;
}
.api-playground-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.api-playground-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(234, 179, 8, 0.12);
  color: #facc15;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.api-playground-title { font-size: 0.9375rem; font-weight: 600; margin: 0 0 2px; }
.api-playground-hint { font-size: 0.75rem; color: var(--text-muted); margin: 0; }
.api-base-line {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin: 0 0 6px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  border: 1px solid rgba(55, 65, 81, 0.45);
}
.api-auth-line {
  margin: 0 0 12px;
  color: var(--text-muted);
}
.api-auth-line--ok { color: #86efac; }

.api-try-endpoint {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(55, 65, 81, 0.55);
  border-radius: 10px;
}
.api-try-path {
  font-size: 0.8125rem;
  color: #93c5fd;
  word-break: break-all;
}

.api-method-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.25rem;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  font-family: ui-monospace, monospace;
  flex-shrink: 0;
}
.api-method-pill--get { background: rgba(34, 197, 94, 0.2); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.35); }
.api-method-pill--post { background: rgba(59, 130, 246, 0.2); color: #93c5fd; border: 1px solid rgba(59, 130, 246, 0.35); }
.api-method-pill--patch { background: rgba(168, 85, 247, 0.2); color: #d8b4fe; border: 1px solid rgba(168, 85, 247, 0.35); }
.api-method-pill--delete { background: rgba(239, 68, 68, 0.2); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.35); }

.api-playground-card .api-try-toolbar {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
  margin-bottom: 10px;
}
.api-try-select { flex: 1; min-width: 0; }
.api-try-send {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0 16px;
  border-radius: 12px;
  white-space: nowrap;
}
.api-try-send:disabled { opacity: 0.65; cursor: wait; }
.api-try-send-spinner {
  display: none !important;
  animation: api-spin 0.85s linear infinite;
}
.api-try-send.is-loading .api-try-send-icon { display: none !important; }
.api-try-send.is-loading .api-try-send-spinner {
  display: inline-block !important;
}
.api-try-slow-hint {
  font-size: 0.7rem;
  color: #fcd34d;
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(234, 179, 8, 0.08);
  border: 1px solid rgba(234, 179, 8, 0.25);
}
@keyframes api-spin {
  to { transform: rotate(360deg); }
}
.api-try-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.api-try-body {
  width: 100%;
  resize: vertical;
  min-height: 7rem;
  font-size: 0.75rem;
  line-height: 1.45;
  background: rgba(0, 0, 0, 0.35);
  border-color: rgba(55, 65, 81, 0.65);
}

.api-try-response-panel { margin-top: 14px; }
.api-try-response-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.api-try-status {
  font-size: 0.65rem;
  font-weight: 700;
  font-family: ui-monospace, monospace;
  padding: 3px 8px;
  border-radius: 6px;
}
.api-try-status--ok {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.35);
}
.api-try-status--err {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
}
.api-try-response-box {
  position: relative;
  min-height: 8rem;
  border-radius: 10px;
  border: 1px solid rgba(55, 65, 81, 0.55);
  background: rgba(0, 0, 0, 0.4);
  overflow: hidden;
}
.api-try-loader {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: none !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.92);
  color: #93c5fd;
  font-size: 0.8125rem;
  pointer-events: none;
}
.api-try-loader.is-active {
  display: flex !important;
}
.api-try-loader i {
  font-size: 1.75rem;
  animation: api-spin 0.85s linear infinite;
}
.api-try-response {
  max-height: 16rem;
  overflow: auto;
  margin: 0;
  padding: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 8rem;
}
.api-try-response--loading { opacity: 0.35; }

.api-docs-panel {
  border: 1px solid rgba(55, 65, 81, 0.55);
  background: rgba(15, 23, 42, 0.35);
}
.api-docs-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(55, 65, 81, 0.45);
}
.api-docs-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(59, 130, 246, 0.12);
  color: #93c5fd;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}
.api-docs-title { font-size: 0.9375rem; font-weight: 600; margin: 0 0 4px; }
.api-docs-note { font-size: 0.75rem; color: var(--text-muted); margin: 0; line-height: 1.45; }

.api-methods-list { display: flex; flex-direction: column; gap: 0.75rem; }
.api-doc-card {
  border: 1px solid rgba(55, 65, 81, 0.55);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.api-doc-card:hover {
  border-color: rgba(59, 130, 246, 0.35);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}
.api-doc-head {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.75rem 0.85rem;
  text-align: left;
  background: rgba(30, 41, 59, 0.35);
  border: none;
  color: inherit;
  cursor: pointer;
}
.api-doc-head:hover { background: rgba(59, 130, 246, 0.08); }
.api-doc-path {
  flex: 1;
  min-width: 0;
  font-size: 0.75rem;
  color: #93c5fd;
  text-align: left;
}
.api-doc-price {
  font-size: 0.7rem;
  font-weight: 600;
  color: #fbbf24;
  flex-shrink: 0;
}
.api-doc-summary {
  font-size: 0.8125rem;
  color: var(--text-secondary, #cbd5e1);
  padding: 0 0.85rem 0.65rem;
  margin: 0;
  line-height: 1.45;
}
.api-doc-notes {
  font-size: 0.7rem;
  color: var(--text-muted);
  padding: 0 0.85rem 0.65rem;
  margin: 0;
  border-top: 1px solid rgba(55, 65, 81, 0.35);
  padding-top: 0.5rem;
}
.api-doc-details { padding: 0 0.85rem 0.85rem; }
.api-doc-details summary {
  list-style: none;
  font-size: 0.7rem;
  color: rgba(250, 204, 21, 0.9);
  cursor: pointer;
  padding: 4px 0;
}
.api-doc-details summary::-webkit-details-marker { display: none; }
.api-doc-ex-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin: 10px 0 4px;
}
.api-doc-pre {
  font-size: 0.7rem;
  max-height: 10rem;
  overflow: auto;
}

@media (min-width: 768px) {
  .api-methods-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
  }
  .api-doc-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    max-width: calc(50% - 0.425rem);
  }
}

/* Buttons */
.btn-gradient-reverse {
  background: linear-gradient(135deg, var(--accent-reverse), var(--accent-reverse-light));
  color: white;
  border: none;
  transition: all 0.2s;
}
.btn-gradient-reverse:hover { filter: brightness(1.1); box-shadow: 0 0 30px rgba(59, 130, 246, 0.4); }

.btn-gradient-ssn {
  background: linear-gradient(135deg, var(--accent-ssn), var(--accent-ssn-light));
  color: white;
}
.btn-gradient-scoring {
  background: linear-gradient(135deg, var(--accent-scoring), var(--accent-scoring-light));
  color: white;
}

/* Shimmer progress */
.progress-track {
  background: var(--surface-elevated);
  border-radius: 9999px;
  overflow: hidden;
  height: 8px;
}
.progress-fill {
  height: 100%;
  border-radius: 9999px;
  position: relative;
  overflow: hidden;
  transition: width 0.3s ease;
}
.progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Live pulse dot */
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-scoring);
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2); }
}

/* Glass modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}
.modal-backdrop.active { opacity: 1; visibility: visible; }
.modal-panel {
  background: rgba(26, 29, 43, 0.85);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  max-width: 480px;
  width: 90%;
  transform: scale(0.95);
  transition: transform 0.2s;
}
.modal-backdrop.active .modal-panel { transform: scale(1); }

/* Toggle switch */
.toggle-switch {
  width: 44px;
  height: 24px;
  background: var(--border);
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
}
.toggle-switch.on { background: var(--accent-reverse); }
.toggle-switch::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform 0.2s;
}
.toggle-switch.on::after { transform: translateX(20px); }

/* Nav active states */
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s;
  font-size: 0.875rem;
}
.nav-item:hover { background: var(--surface-elevated); color: var(--text-primary); }
.nav-item.active-reverse { background: rgba(59, 130, 246, 0.15); color: var(--accent-reverse-light); }
.nav-item.active-ssn { background: rgba(168, 85, 247, 0.15); color: var(--accent-ssn-light); }
.nav-item.active-scoring { background: rgba(16, 185, 129, 0.15); color: var(--accent-scoring-light); }
.nav-item.active-billing { background: rgba(245, 158, 11, 0.15); color: var(--accent-billing-light); }
.nav-item.active-default { background: var(--surface-elevated); color: var(--text-primary); }
.nav-item.active-danger { background: rgba(239, 68, 68, 0.15); color: var(--accent-danger-light); }

/* Tailwind .hidden is overridden by .nav-item / .sheet-action display rules above */
.nav-item.hidden,
.sheet-action.hidden,
[data-requires-api].hidden {
  display: none !important;
}

/* View panels */
.view-panel { display: none; animation: fadeIn 0.2s ease; }
.view-panel.active { display: block; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Badges */
.badge { display: inline-flex; padding: 2px 8px; border-radius: 6px; font-size: 0.75rem; font-weight: 500; }
.badge-reverse { background: rgba(59,130,246,0.2); color: #60A5FA; }
.badge-ssn { background: rgba(168,85,247,0.2); color: #C084FC; }
.badge-scoring { background: rgba(16,185,129,0.2); color: #34D399; }
.badge-billing { background: rgba(245,158,11,0.2); color: #FBBF24; }
.badge-success { background: rgba(16,185,129,0.2); color: #34D399; }
.badge-pending { background: rgba(245,158,11,0.2); color: #FBBF24; }
.badge-failed { background: rgba(239,68,68,0.2); color: #F87171; }

/* Chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}
.chip:hover, .chip.active { border-color: var(--accent-reverse); color: var(--accent-reverse-light); background: rgba(59,130,246,0.1); }

/* Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  animation: slideIn 0.3s ease;
  min-width: 280px;
}
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Tooltip */
[data-tooltip] { position: relative; }
[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  white-space: nowrap;
  z-index: 10;
  margin-bottom: 4px;
}

/* FICO scale */
.fico-scale {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #EF4444 0%, #F59E0B 25%, #10B981 50%, #3B82F6 75%, #8B5CF6 100%);
  position: relative;
}
.fico-marker {
  position: absolute;
  top: -6px;
  width: 4px;
  height: 24px;
  background: white;
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(255,255,255,0.5);
}

/* Log terminal */
.log-terminal {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.75rem;
  background: #0A0B14;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  height: 400px;
  overflow-y: auto;
}
.log-line-info { color: #60A5FA; }
.log-line-warn { color: #FBBF24; }
.log-line-error { color: #F87171; }

/* Mobile */
@media (max-width: 767px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.active { display: block; }
  .main-wrapper { margin-left: 0; }
  .main-content { padding: 16px; }
}

/* Table */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table th {
  text-align: left;
  padding: 12px;
  color: var(--text-muted);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}
.data-table tr:hover td { background: var(--surface-elevated); }

/* Input */
.input-field {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text-primary);
  width: 100%;
  transition: border-color 0.2s;
}
.input-field:focus {
  outline: none;
  border-color: var(--accent-reverse);
}

/* Sparkline */
.sparkline { width: 100%; height: 48px; }

/* ===== Stats page ===== */
.stats-page { max-width: 960px; }
.stats-hero {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12) 0%, rgba(168, 85, 247, 0.08) 50%, transparent 100%);
  border-color: rgba(59, 130, 246, 0.25);
}
.stats-hero-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.stats-hero-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 4px;
  letter-spacing: -0.02em;
}
.stats-period-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.stats-period-chips .chip { flex: 1; min-width: calc(50% - 4px); justify-content: center; }
@media (min-width: 480px) {
  .stats-period-chips .chip { flex: 1; min-width: 0; }
}

.stats-spent-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.stats-spent-value { font-size: 1.75rem; font-weight: 700; margin-top: 4px; }

.stats-kpi-card { position: relative; overflow: hidden; }
.stats-kpi-value { font-size: 1.35rem; font-weight: 700; margin-top: 4px; line-height: 1.2; }
.stats-trend {
  font-size: 0.7rem;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.stats-trend-up { color: #34D399; }
.stats-trend-down { color: #F87171; }
.stats-trend-neutral { color: var(--text-muted); }

.stats-charts-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 768px) {
  .stats-charts-row { grid-template-columns: 1.2fr 1fr; }
}

.stats-chart-card { padding: 16px; }
.stats-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
  gap: 12px;
}
.stats-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.stats-card-title i { color: var(--accent-reverse-light); font-size: 1.1rem; }
.stats-card-sub { font-size: 0.7rem; color: var(--text-muted); margin: 4px 0 0; }

.stats-volume-chart { height: 140px; width: 100%; }
.stats-line-chart { height: 100px; width: 100%; }
.stats-svg { width: 100%; height: 100%; display: block; }
.stats-grid-line { stroke: var(--border); stroke-width: 0.15; stroke-dasharray: 2 2; }
.stats-axis-label { fill: var(--text-muted); font-size: 3px; font-family: Inter, system-ui, sans-serif; }
.stats-bar-rect { transition: opacity 0.2s; }

.stats-mix-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
@media (min-width: 480px) {
  .stats-mix-card .stats-mix-body { flex-direction: row; align-items: center; justify-content: space-around; }
}
.stats-donut-inner { flex-shrink: 0; }
.stats-donut-svg { width: 140px; height: 140px; }
.stats-donut-center-num { fill: var(--text-primary); font-size: 11px; font-weight: 700; font-family: Inter, system-ui, sans-serif; }
.stats-donut-center-lbl { fill: var(--text-muted); font-size: 5px; font-family: Inter, system-ui, sans-serif; }

.stats-mix-legend { width: 100%; max-width: 220px; display: flex; flex-direction: column; gap: 10px; }
.stats-legend-row {
  display: grid;
  grid-template-columns: 10px 24px 1fr auto auto;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
}
.stats-legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.stats-legend-icon { color: var(--text-muted); font-size: 0.9rem; }
.stats-legend-label { color: var(--text-secondary); }
.stats-legend-pct { font-weight: 600; color: var(--text-primary); }
.stats-legend-count { color: var(--text-muted); font-size: 0.75rem; }

.stats-service-row { margin-bottom: 14px; }
.stats-service-row:last-child { margin-bottom: 0; }
.stats-service-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.stats-service-name { flex: 1; font-size: 0.85rem; font-weight: 500; color: var(--text-primary); }
.stats-service-num { font-weight: 600; color: var(--text-secondary); font-size: 0.85rem; }
.stats-service-track {
  height: 8px;
  background: var(--surface-elevated);
  border-radius: 999px;
  overflow: hidden;
}
.stats-service-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.stats-insights-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (min-width: 640px) {
  .stats-insights-grid { grid-template-columns: repeat(4, 1fr); }
}
.stats-insight {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 108px;
}
.stats-insight-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 4px;
}
.stats-insight-title { font-size: 0.7rem; color: var(--text-muted); margin: 0; }
.stats-insight-value { font-size: 1rem; font-weight: 700; color: var(--text-primary); margin: 0; line-height: 1.2; }
.stats-insight-sub { font-size: 0.65rem; color: var(--text-muted); margin: 0; }

/* ===== Telegram Mini App / Mobile-first ===== */
:root {
  --header-h: 52px;
  --bottom-nav-h: 60px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

html.tg-desktop {
  height: 100%;
}

html.tg-desktop body.tg-app {
  height: 100%;
  overflow: hidden;
}

html.tg-desktop body.tg-app #app-root.tma-shell {
  height: 100%;
  max-height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

html.tg-desktop body.tg-app .tma-column {
  min-height: 0;
  height: 100%;
}

html.tg-desktop body.tg-app .tma-main {
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

body.tg-app {
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
}

body.sheet-open { overflow: hidden; }

/* TMA shell: mobile default */
.tma-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-top: var(--safe-top);
}

.tma-header {
  height: var(--header-h);
  min-height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 30;
  flex-shrink: 0;
}

/* Brand logo (header / sidebar) */
.lh-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
  flex-shrink: 0;
}
.lh-brand:hover .lh-logo-mark {
  transform: translateY(-1px);
  filter: drop-shadow(0 2px 8px rgba(15, 23, 42, 0.45));
}
.lh-logo-mark {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  transition: transform 0.22s ease, filter 0.22s ease;
}
.lh-brand--user:hover .lh-logo-mark {
  filter: drop-shadow(0 2px 10px rgba(59, 130, 246, 0.18));
}
.lh-brand--admin:hover .lh-logo-mark {
  filter: drop-shadow(0 2px 10px rgba(239, 68, 68, 0.2));
}
.lh-logo-word {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: 1.0625rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.1;
  white-space: nowrap;
}
.lh-logo-lookup {
  color: #e2e8f0;
  font-weight: 500;
}
.lh-brand--user .lh-logo-lookup,
.lh-brand--user .lh-logo-hub-h,
.lh-brand--user .lh-logo-hub-u,
.lh-brand--user .lh-logo-hub-b {
  color: #ffffff;
}
.lh-logo-hub {
  display: inline-flex;
  font-weight: 700;
  letter-spacing: 0.02em;
}
/* H = reverse · u = SSN · b = scoring (admin keeps accent colors) */
.lh-brand--admin .lh-logo-hub-h--admin {
  color: #f87171;
}
.lh-brand--admin .lh-logo-hub-u--admin {
  color: #fb923c;
}
.lh-brand--admin .lh-logo-hub-b--admin {
  color: #fcd34d;
}
.lh-brand-badge {
  margin-left: 2px;
  flex-shrink: 0;
}
.lh-brand--header .lh-brand-badge { display: none; }
.lh-brand--mark-only .lh-logo-word { display: none; }

.tma-header-brand {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}

.balance-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-billing-light);
  text-decoration: none;
  flex-shrink: 0;
}

.tma-main {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
  padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 20px);
}

/* Bottom navigation (primary on mobile / Telegram) */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--bottom-nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  z-index: 40;
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.65rem;
  padding: 6px 4px;
  min-height: 48px;
  border: none;
  background: none;
  cursor: pointer;
  transition: color 0.15s;
}

.bottom-nav-item i { font-size: 1.35rem; }
.bottom-nav-item span { font-size: 0.6rem; line-height: 1.1; max-width: 4.5rem; overflow: hidden; text-overflow: ellipsis; }
.nav-item span { flex: 1; }
.bottom-nav-item.active { color: var(--accent-reverse-light); }
.bottom-nav-item.active-billing { color: var(--accent-billing-light); }
.bottom-nav-item.active-danger { color: var(--accent-danger-light); }

.bottom-nav-fab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -20px;
}

.bottom-nav-fab button {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--accent-reverse), var(--accent-ssn));
  color: white;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.45);
  font-size: 1.5rem;
}

/* Bottom sheet */
.bottom-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 55;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}
.bottom-sheet-backdrop.active { opacity: 1; visibility: visible; }

.bottom-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  padding: 12px 16px calc(16px + var(--safe-bottom));
  z-index: 56;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  max-height: 70vh;
  overflow-y: auto;
}
.bottom-sheet-backdrop.active .bottom-sheet { transform: translateY(0); }

.sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto 16px;
}

.sheet-action {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: none;
  background: var(--surface-elevated);
  color: var(--text-primary);
  font-size: 1rem;
  margin-bottom: 8px;
  text-align: left;
  min-height: 52px;
  cursor: pointer;
}

.sheet-action i { font-size: 1.4rem; }

/* Mobile list cards (replace tables on small screens) */
.list-cards { display: flex; flex-direction: column; gap: 10px; }
.list-card {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}
.list-card-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.list-card-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 6px; }

/* KPI grid mobile */
.kpi-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.kpi-grid .card { padding: 14px; }
.kpi-grid .card p.text-3xl, .kpi-grid .card p.text-2xl { font-size: 1.35rem; }

/* Quick actions stack on mobile */
.quick-actions { display: flex; flex-direction: column; gap: 10px; }
.quick-action-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 14px;
  border: none;
  color: white;
  text-align: left;
  min-height: 56px;
  width: 100%;
  cursor: pointer;
}

/* Touch-friendly buttons */
.btn-touch {
  min-height: 48px;
  padding: 12px 20px;
  font-size: 1rem;
  border-radius: 12px;
}

/* Desktop sidebar — hidden on mobile */
.desktop-sidebar { display: none; }
.table-desktop { display: none; }

/* Crypto payment icons */
.crypto-icon,
[data-crypto-icon] {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  background: transparent;
  padding: 0;
  line-height: 0;
}
.crypto-icon svg,
[data-crypto-icon] svg,
.crypto-icon__img,
.crypto-icon img,
[data-crypto-icon] img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 50%;
}
.crypto-icon--btc,
[data-crypto-icon="btc"] { box-shadow: 0 6px 22px rgba(247, 147, 26, 0.45); }
.crypto-icon--eth,
[data-crypto-icon="eth"] { box-shadow: 0 6px 22px rgba(98, 126, 234, 0.45); }
.crypto-icon--usdt,
[data-crypto-icon="usdt"] { box-shadow: 0 6px 22px rgba(38, 161, 123, 0.45); }

.crypto-block {
  padding: 14px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.crypto-block-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.crypto-block-title { font-size: 0.9rem; font-weight: 600; color: var(--text-primary); line-height: 1.2; }
.crypto-block-ticker { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }
.crypto-net-badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 8px;
  margin-left: auto;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  letter-spacing: 0.02em;
}
.crypto-net-badge--btc { background: rgba(247, 147, 26, 0.15); color: #FBBF24; border: 1px solid rgba(247, 147, 26, 0.35); }
.crypto-net-badge--eth { background: rgba(98, 126, 234, 0.15); color: #93C5FD; border: 1px solid rgba(98, 126, 234, 0.35); }
.crypto-net-badge--trc { background: rgba(239, 68, 68, 0.12); color: #FCA5A5; border: 1px solid rgba(239, 68, 68, 0.3); }
.crypto-net-badge--erc { background: rgba(98, 126, 234, 0.12); color: #A5B4FC; border: 1px solid rgba(98, 126, 234, 0.3); }
.crypto-net-badge--bep { background: rgba(245, 158, 11, 0.12); color: #FCD34D; border: 1px solid rgba(245, 158, 11, 0.35); }

.crypto-block--usdt { border-color: rgba(38, 161, 123, 0.25); }
.crypto-block-head--usdt { margin-bottom: 12px; }
.crypto-network-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.crypto-network-item {
  padding: 12px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.crypto-network-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 8px;
}

.pay-method {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.pay-method .crypto-icon,
.crypto-icon--sm,
[data-crypto-icon][data-crypto-sm] { width: 28px; height: 28px; border-radius: 50%; }

.topup-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.topup-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 56px;
  transition: border-color 0.2s, transform 0.15s;
}
.topup-btn:hover { transform: translateY(-1px); }
.topup-btn--active {
  border-color: rgba(96, 165, 250, 0.75) !important;
  box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.5), 0 0 18px rgba(59, 130, 246, 0.22);
}
.topup-btn--hot { border-color: rgba(245, 158, 11, 0.6) !important; box-shadow: 0 0 20px rgba(245, 158, 11, 0.15); }

.deposit-pay-card { border: 1px solid rgba(245, 158, 11, 0.35); }
.deposit-pay-banner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fecaca;
  font-size: 0.75rem;
  line-height: 1.35;
}
.deposit-pay-banner i { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.deposit-pay-amount { letter-spacing: 0.02em; word-break: break-all; }
.deposit-status-badge {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: var(--text-muted);
}
.deposit-status-badge--pending { color: #fde68a; border-color: rgba(245, 158, 11, 0.5); }
.deposit-status-badge--processing { color: #93c5fd; border-color: rgba(59, 130, 246, 0.5); }
.deposit-status-badge--confirmed { color: #86efac; border-color: rgba(34, 197, 94, 0.5); }
.deposit-status-badge--expired,
.deposit-status-badge--rejected { color: #fca5a5; border-color: rgba(239, 68, 68, 0.45); }
.deposit-intent-row {
  border: 1px solid rgba(55, 65, 81, 0.7);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.deposit-intent-row:hover { border-color: rgba(96, 165, 250, 0.45); }
.deposit-intent-row--active {
  border-color: rgba(245, 158, 11, 0.55);
  background: rgba(245, 158, 11, 0.06);
}
.deposit-intent-row--selected {
  border-color: rgba(96, 165, 250, 0.65);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.25);
}
.deposit-wallet-pick {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(55, 65, 81, 0.7);
  background: rgba(15, 23, 42, 0.35);
  transition: border-color 0.15s, background 0.15s;
}
.deposit-wallet-pick .crypto-icon,
.deposit-wallet-pick [data-crypto-icon] {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}
.deposit-wallet-pick__body {
  flex: 1;
  min-width: 0;
}
.deposit-wallet-pick:hover { border-color: rgba(96, 165, 250, 0.45); }
.deposit-wallet-pick--selected {
  border-color: rgba(245, 158, 11, 0.6);
  background: rgba(245, 158, 11, 0.08);
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.25);
}
.deposit-wallet-pick:disabled { opacity: 0.45; cursor: not-allowed; }

.deposit-pay-network-line {
  margin-bottom: 4px;
}
.deposit-pay-network-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.deposit-pay-network-row .crypto-icon,
.deposit-pay-network-row [data-crypto-icon] {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.deposit-history-panel { margin-top: 8px; opacity: 0.92; }
.deposit-history-panel[open] { opacity: 1; }
.deposit-history-summary { list-style: none; }
.deposit-history-summary::-webkit-details-marker { display: none; }
.deposit-history-pagination button:disabled { opacity: 0.35; }

.kpi-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.kpi-label i { font-size: 1rem; opacity: 0.85; }

/* Desktop shell + aligned header */
@media (min-width: 768px) {
  :root {
    --desktop-bar-h: 64px;
    --sidebar-width: 240px;
  }

  .bottom-nav { display: none; }

  .tma-shell.has-sidebar {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    padding-left: 0;
    min-height: 100vh;
    min-height: 100dvh;
  }

  .desktop-sidebar {
    display: flex;
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    flex-direction: column;
    background: var(--surface);
    border-right: 1px solid var(--border);
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
    height: 100dvh;
    z-index: 35;
    flex-shrink: 0;
    padding-top: var(--safe-top);
  }

  .desktop-sidebar-head {
    height: var(--desktop-bar-h);
    min-height: var(--desktop-bar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    gap: 8px;
  }

  .desktop-sidebar-head .lh-brand {
    min-width: 0;
    flex: 1;
  }
  .desktop-sidebar-head .lh-logo-mark {
    width: 34px;
    height: 34px;
  }
  .desktop-sidebar-head .lh-logo-word {
    font-size: 1.05rem;
  }

  .desktop-sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
  }

  .desktop-sidebar-foot {
    padding: 12px 16px 16px;
    flex-shrink: 0;
  }

  .sidebar-balance-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s;
  }
  .sidebar-balance-card:hover { border-color: rgba(245, 158, 11, 0.4); }

  .tma-column {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
  }

  .tma-header {
    height: var(--desktop-bar-h);
    min-height: var(--desktop-bar-h);
    padding: 0 28px;
    align-items: center;
    justify-content: flex-end;
  }

  /* Logo with wordmark only in sidebar on desktop — no duplicate mark in header */
  .tma-header-brand { display: none !important; }

  .tma-main {
    padding: 28px 32px 32px;
    padding-bottom: 32px;
  }

  .table-desktop { display: table; width: 100%; }
  .list-cards.mobile-only { display: none; }
  .kpi-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; }
  .quick-actions { flex-direction: row; gap: 14px; }
  .quick-actions .quick-action-btn { flex: 1; flex-direction: column; align-items: flex-start; }
  .topup-grid { gap: 12px; }
  .toast-container {
    bottom: 24px;
    right: 24px;
    left: auto;
  }
}

@media (max-width: 479px) {
  .topup-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767px) {
  .desktop-sidebar-head,
  .desktop-sidebar-foot,
  .sidebar-balance-card { display: none; }
  .lh-brand--header .lh-logo-mark { width: 36px; height: 36px; }
  .lh-brand--header .lh-logo-word { display: flex; font-size: 1.15rem; }
}

@media (max-width: 767px) {
  .table-desktop { display: none !important; }
  .list-cards.mobile-only { display: flex; }
  .hide-mobile { display: none !important; }
  .toast-container {
    left: 16px;
    right: 16px;
    bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 12px);
  }
  .toast { min-width: auto; width: 100%; }
  .modal-panel { width: 100%; max-width: none; border-radius: 20px 20px 0 0; align-self: flex-end; margin-top: auto; }
  .modal-backdrop { align-items: flex-end; }
}

/* Admin badge */
.badge-admin { background: rgba(239,68,68,0.2); color: #F87171; }

.tg-badge {
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(0, 136, 204, 0.2);
  color: #54a9eb;
  margin-left: 8px;
}
.tg-badge--beta {
  background: rgba(255, 255, 255, 0.08);
  color: #f1f5f9;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: lowercase;
}

/* API-aligned forms (revers / credit_score) */
.api-endpoint {
  font-size: 0.7rem;
  font-family: ui-monospace, Consolas, monospace;
  color: var(--accent-reverse-light);
}
.field-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.field-label .api-key {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-family: ui-monospace, Consolas, monospace;
  margin-left: 6px;
}
.json-preview {
  font-size: 0.65rem;
  font-family: ui-monospace, Consolas, monospace;
  background: #0A0B14;
  border: 1px solid var(--border);
  padding: 10px;
  border-radius: 8px;
  max-height: 200px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
}
.result-section { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.result-kv {
  display: grid;
  grid-template-columns: minmax(72px, 28%) 1fr;
  gap: 6px 10px;
  font-size: 0.8rem;
}
.result-kv .text-muted { color: var(--text-muted); }
.pipeline-step { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 0.8rem; }
.pipeline-step.done { color: #34D399; }
.pipeline-step.active { color: #FBBF24; }
.pipeline-step.pending { color: var(--text-muted); }
.scoring-form--locked { opacity: 0.92; }
#scoring-form-card {
  scroll-margin-top: 12px;
}
.score-recent-wrap {
  padding: 10px 12px !important;
  margin-bottom: 12px !important;
}
.score-recent-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(52, 211, 153, 0.12);
}
.score-recent-head-title {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.score-recent-head-title .ti { font-size: 0.8rem; color: #34d399; vertical-align: -1px; }
.score-recent-head-hint {
  font-size: 0.65rem;
  color: var(--text-muted);
  opacity: 0.75;
  white-space: nowrap;
}
.score-recent-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 240px;
  overflow-y: auto;
  scrollbar-color: rgba(52, 211, 153, 0.45) rgba(10, 11, 20, 0.9);
}
.score-recent-list::-webkit-scrollbar {
  width: 5px;
}
.score-recent-list::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(52, 211, 153, 0.35), rgba(16, 185, 129, 0.5));
  border: none;
}
.score-recent-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(52, 211, 153, 0.1);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.score-recent-item--group {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding-bottom: 6px;
}
.score-recent-item-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.score-recent-item--group:hover {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(52, 211, 153, 0.22);
}
.score-recent-item:not(.score-recent-item--group):hover {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(52, 211, 153, 0.22);
}
.score-recent-alts {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 4px 0 0 10px;
  padding-left: 8px;
  border-left: 2px solid rgba(52, 211, 153, 0.18);
}
.score-recent-alt-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
}
.score-recent-alt-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  margin-left: auto;
}
.score-recent-alt-name {
  flex: 1;
  min-width: 0;
  font-size: 0.68rem;
  color: rgba(148, 163, 184, 0.92);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.score-recent-run--alt {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
.score-recent-run--loading {
  opacity: 0.55;
  pointer-events: none;
}
.score-recent-run--loading .ti {
  animation: rev-spin 0.8s linear infinite;
}
.score-recent-item-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  line-height: 1.2;
}
.score-recent-phone {
  flex-shrink: 0;
  font-weight: 600;
  color: #e2e8f0;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}
.score-recent-dot {
  color: rgba(148, 163, 184, 0.5);
  flex-shrink: 0;
}
.score-recent-sub {
  flex: 1;
  min-width: 0;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.score-recent-date {
  flex-shrink: 0;
  font-size: 0.65rem;
  color: rgba(148, 163, 184, 0.65);
}
.score-recent-item-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.score-recent-fico {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  font-variant-numeric: tabular-nums;
}
.score-recent-fico .ti { font-size: 0.65rem; }
.score-recent-fico--pending {
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
}
.score-recent-fico--load {
  background: rgba(56, 189, 248, 0.12);
  color: #7dd3fc;
}
.score-recent-fico--fail {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  padding: 2px 5px;
}
.score-recent-fico--outcome {
  background: rgba(56, 189, 248, 0.12);
  color: #7dd3fc;
  padding: 2px 6px;
  max-width: 160px;
}
.score-recent-outcome-text {
  font-size: 0.62rem;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 120px;
}
.score-recent-run {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 7px;
  border: none;
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.score-recent-run:hover {
  background: rgba(16, 185, 129, 0.35);
  color: #a7f3d0;
  transform: scale(1.05);
}
.score-recent-run .ti { font-size: 0.9rem; }
.score-recent-empty {
  margin: 0;
  padding: 8px 4px;
  font-size: 0.72rem;
}
.job-queue-wrap {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.12);
}
.job-queue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.job-queue-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.job-queue-cancel-all {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid rgba(248, 113, 113, 0.35);
  background: rgba(127, 29, 29, 0.25);
  color: #fca5a5;
  font-size: 0.62rem;
  font-weight: 600;
  cursor: pointer;
}
.job-queue-cancel-all:hover {
  background: rgba(127, 29, 29, 0.45);
  border-color: rgba(248, 113, 113, 0.55);
}
.job-queue-cancel-all .ti { font-size: 0.75rem; }
.job-queue-title {
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(226, 232, 240, 0.85);
  display: flex;
  align-items: center;
  gap: 6px;
}
.job-queue-title .ti { font-size: 0.85rem; opacity: 0.85; }
.job-queue-count {
  font-size: 0.65rem;
  color: rgba(148, 163, 184, 0.75);
  font-variant-numeric: tabular-nums;
}
.job-queue-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}
.job-queue-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(30, 41, 59, 0.45);
  color: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.job-queue-item:hover {
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(30, 41, 59, 0.65);
}
.job-queue-item--focus {
  border-color: rgba(96, 165, 250, 0.45);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.15);
}
.job-queue-item--reverse.job-queue-item--focus {
  border-color: rgba(96, 165, 250, 0.45);
}
.job-queue-item--scoring.job-queue-item--focus {
  border-color: rgba(52, 211, 153, 0.45);
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.12);
}
.job-queue-item--success { border-color: rgba(16, 185, 129, 0.25); }
.job-queue-item--outcome { border-color: rgba(56, 189, 248, 0.28); }
.job-queue-item--failed { border-color: rgba(248, 113, 113, 0.3); }
.job-queue-item-badge {
  flex-shrink: 0;
  min-width: 2.1rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.9);
  padding: 4px 6px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.55);
  text-align: center;
}
.job-queue-item-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.job-queue-item-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.job-queue-item-sub {
  font-size: 0.68rem;
  color: rgba(148, 163, 184, 0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.job-queue-item-status {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.65rem;
  color: rgba(148, 163, 184, 0.9);
  text-align: right;
  max-width: 42%;
  line-height: 1.25;
}
.job-queue-retry {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(167, 139, 250, 0.35);
  border-radius: 8px;
  background: rgba(88, 28, 135, 0.2);
  color: #c4b5fd;
  cursor: pointer;
}
.job-queue-retry:hover { background: rgba(88, 28, 135, 0.38); }
.job-queue-retry .ti { font-size: 0.95rem; pointer-events: none; }
.job-queue-item--running .job-queue-item-status { color: #93c5fd; }
.job-queue-step {
  display: inline-block;
  margin-left: 4px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #a5f3fc;
}
.job-queue-item--success .job-queue-item-status { color: #6ee7b7; }
.job-queue-item--outcome .job-queue-item-status { color: #7dd3fc; }
.job-queue-item--failed .job-queue-item-status { color: #fca5a5; }
.job-queue-fico {
  font-size: 0.72rem;
  font-weight: 700;
  color: #6ee7b7;
  margin-left: 4px;
}
.scoring-loader { display: flex; flex-direction: column; gap: 10px; }
.scoring-loader-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
}
.scoring-loader-spin {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.35);
  color: #6ee7b7;
  font-size: 1.15rem;
}
.scoring-loader-spin .ti { animation: rev-spin 0.85s linear infinite; }
.scoring-loader-spin--done {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(52, 211, 153, 0.55);
  color: #34d399;
}
.scoring-loader-spin--done .ti,
.scoring-loader-spin--error .ti { animation: none; }
.scoring-loader-spin--error {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(248, 113, 113, 0.45);
  color: #f87171;
}
.scoring-loader-meta { flex: 1; min-width: 0; }
.scoring-loader-label {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: #fde68a;
  line-height: 1.3;
  transition: color 0.25s ease;
}
.scoring-loader-label--done { color: #6ee7b7; }
.scoring-loader-label--error { color: #fca5a5; }
.scoring-loader-step-n {
  margin: 2px 0 0;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.scoring-loader-track { margin: 0; height: 6px; border-radius: 999px; }
.scoring-outcome-card { border-width: 1px; border-style: solid; }
.scoring-outcome-card--frozen { border-color: rgba(56, 189, 248, 0.45); background: linear-gradient(145deg, rgba(14, 116, 144, 0.18), rgba(15, 17, 23, 0.9)); }
.scoring-outcome-card--locked { border-color: rgba(251, 191, 36, 0.45); background: linear-gradient(145deg, rgba(180, 83, 9, 0.16), rgba(15, 17, 23, 0.9)); }
.scoring-outcome-card--decline { border-color: rgba(248, 113, 113, 0.4); background: linear-gradient(145deg, rgba(127, 29, 29, 0.2), rgba(15, 17, 23, 0.9)); }
.scoring-outcome-card--thin,
.scoring-outcome-card--noOffers,
.scoring-outcome-card--info { border-color: rgba(56, 189, 248, 0.3); }
.scoring-outcome-panel { margin: 0; padding: 0; }
.scoring-outcome-badge {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  max-width: 100%;
}
.scoring-outcome-badge--compact {
  padding: 4px 8px;
  gap: 6px;
  border-radius: 8px;
  max-width: 100%;
}
.scoring-outcome-badge--panel {
  display: flex;
  padding: 14px 16px;
  gap: 12px;
  border: none;
  background: transparent;
}
.scoring-outcome-badge--frozen {
  background: rgba(14, 165, 233, 0.12);
  border-color: rgba(56, 189, 248, 0.35);
  color: #bae6fd;
}
.scoring-outcome-badge--locked {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(251, 191, 36, 0.4);
  color: #fde68a;
}
.scoring-outcome-badge--decline {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(248, 113, 113, 0.35);
  color: #fecaca;
}
.scoring-outcome-badge--thin,
.scoring-outcome-badge--noOffers,
.scoring-outcome-badge--info {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(125, 211, 252, 0.28);
  color: #e0f2fe;
}
.scoring-outcome-badge__icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  font-size: 1.05rem;
}
.scoring-outcome-badge--compact .scoring-outcome-badge__icon {
  width: 22px;
  height: 22px;
  font-size: 0.9rem;
  border-radius: 6px;
}
.scoring-outcome-badge--panel .scoring-outcome-badge__icon {
  width: 40px;
  height: 40px;
  font-size: 1.35rem;
  border-radius: 10px;
}
.scoring-outcome-badge__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.scoring-outcome-badge__kicker {
  margin: 0;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.75;
}
.scoring-outcome-badge__title {
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.25;
}
.scoring-outcome-badge--panel .scoring-outcome-badge__title {
  font-size: 1rem;
  margin: 0;
}
.scoring-outcome-badge__hint {
  font-size: 0.68rem;
  line-height: 1.35;
  opacity: 0.88;
}
.scoring-outcome-badge--panel .scoring-outcome-badge__hint {
  margin: 4px 0 0;
  font-size: 0.78rem;
}
.scoring-outcome-badge--compact .scoring-outcome-badge__title {
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}
.job-queue-item--outcome .job-queue-item-sub {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  line-height: 1.3;
}
.score-recent-outcome-wrap {
  display: inline-flex;
  max-width: 170px;
}
.hist-person-st.outcome-frozen { color: #7dd3fc; }
.hist-person-st.outcome-locked { color: #fcd34d; }
.hist-person-st.outcome-decline { color: #fca5a5; }
.scoring-ssn-panel {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(168, 85, 247, 0.35);
  background: linear-gradient(145deg, rgba(88, 28, 135, 0.22), rgba(15, 17, 23, 0.85));
  pointer-events: auto;
  touch-action: manipulation;
  position: relative;
  z-index: 5;
}
body.tg-app .scoring-ssn-panel input,
body.tg-app .scoring-ssn-panel button {
  pointer-events: auto;
  touch-action: manipulation;
  user-select: text;
  -webkit-user-select: text;
}
body.tg-app .scoring-ssn-panel button {
  user-select: none;
  -webkit-user-select: none;
}
.scoring-ssn-panel-title {
  font-size: 13px;
  font-weight: 600;
  color: #e9d5ff;
  margin-bottom: 4px;
}
.scoring-ssn-applicant {
  font-size: 12px;
  color: #c4b5fd;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.scoring-ssn-countdown {
  font-size: 2rem;
  font-family: ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  color: #fbbf24;
  text-align: center;
  margin: 4px 0 8px;
}
.scoring-ssn-block {
  margin-top: 12px;
}
#scoring-ssn-block[data-ssn-active="1"],
.scoring-ssn-block.scoring-ssn-block--visible,
#scoring-ssn-block.scoring-ssn-block--visible,
.hidden#scoring-ssn-block[data-ssn-active="1"],
.hidden.scoring-ssn-block.scoring-ssn-block--visible {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  max-height: none !important;
  overflow: visible !important;
  height: auto !important;
  min-height: 8rem !important;
}
#modal-ssn-request {
  display: none !important;
  pointer-events: none !important;
}
.scoring-ssn-block .scoring-ssn-panel {
  margin-top: 0;
}
.scoring-ssn-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.scoring-ssn-action-btn--primary {
  grid-column: 1 / -1;
}
.scoring-ssn-fetch--loading {
  opacity: 0.65;
  pointer-events: none;
  cursor: wait;
}
.scoring-ssn-fetch--loading .ti-loader-2 {
  animation: rev-spin 0.85s linear infinite;
}
.rev-ssn-badge .rev-ssn-copy-btn,
.rev-ssn-badge .lh-copy-btn {
  margin-left: 6px;
  vertical-align: middle;
}
.scoring-live-log-line {
  margin: 8px 0 0;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#scoring-pipeline-wrap .rev-progress-bar { background: linear-gradient(90deg, #059669, #34d399); transition: width 0.45s ease; }
#scoring-pipeline-wrap .rev-progress-bar.scoring-progress-bar--done { background: linear-gradient(90deg, #10b981, #6ee7b7); }
.scoring-debug-live-wrap { background: #0f1419; border-radius: 10px; overflow: hidden; border: 1px solid rgba(16,185,129,0.2); }
.scoring-debug-frame { width: 100%; display: block; min-height: 140px; object-fit: contain; background: #111; }
.scoring-debug-log { max-height: 220px; min-height: 140px; overflow: auto; font-size: 0.68rem; line-height: 1.35; margin: 0; padding: 8px; background: #0f1419; border-radius: 8px; color: #a7f3d0; white-space: pre-wrap; word-break: break-word; }
.pipeline-step.error { color: #f87171; }
.pipeline-step.error .ti { animation: none; }
.hist-fico-failed { display: inline-flex; align-items: center; gap: 4px; font-size: 0.75rem; color: #f87171; }

/* Reverse result — wide user card */
.view-panel[data-view="reverse"] { max-width: none; }
.rev-panel {
  width: 100%;
  --rev-text-body: #C8CCD9;
  --rev-text-label: #9CA3B8;
  --rev-text-value: #F0F2F8;
  --rev-text-accent: #93C5FD;
  --rev-text-gold: #FCD34D;
  --rev-text-success: #6EE7B7;
}
.rev-phone-head {
  background: var(--surface-elevated);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
}
.rev-phone-head--hero {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.16) 0%, rgba(168, 85, 247, 0.1) 100%);
  border: 1px solid rgba(59, 130, 246, 0.32);
  box-shadow: 0 8px 32px rgba(59, 130, 246, 0.12);
}
.rev-phone-head-inner { display: flex; align-items: center; gap: 14px; }
.rev-phone-icon-ring {
  width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #3B82F6, #60A5FA);
  color: #fff; font-size: 1.4rem;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.45);
}
.rev-phone-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--rev-text-label); margin-bottom: 4px; display: flex; align-items: center; gap: 4px; }
.rev-phone-num { font-size: 1.3rem; font-weight: 700; color: var(--text-primary); letter-spacing: 0.02em; line-height: 1.2; }
.rev-phone-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.rev-phone-meta { font-size: 0.8rem; color: var(--text-secondary); margin-top: 6px; line-height: 1.4; }

.rev-icon-wrap {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 8px;
  background: rgba(59, 130, 246, 0.15); color: var(--accent-reverse-light);
  flex-shrink: 0;
}
.rev-icon-wrap--sm { width: 22px; height: 22px; border-radius: 6px; font-size: 0.75rem; }
.rev-icon-wrap--lg { width: 40px; height: 40px; border-radius: 10px; font-size: 1.1rem; }
.rev-icon-wrap--amber { background: rgba(251, 191, 36, 0.15); color: #FBBF24; }

.rev-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.68rem; font-weight: 500;
  padding: 4px 10px; border-radius: 20px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
}
.rev-chip i { font-size: 0.85rem; opacity: 0.9; }
.rev-chip--blue { border-color: rgba(59, 130, 246, 0.45); background: rgba(59, 130, 246, 0.18); color: #BFDBFE; font-weight: 600; }
.rev-chip--accent { border-color: rgba(96, 165, 250, 0.5); background: rgba(59, 130, 246, 0.22); color: #E0F2FE; font-weight: 600; }
.rev-chip--soft { border-color: rgba(148, 163, 184, 0.35); background: rgba(148, 163, 184, 0.12); color: var(--rev-text-body); }
.rev-chip--muted { color: var(--rev-text-label); }

.rev-search-card .rev-search-head { display: flex; align-items: center; gap: 12px; }
.rev-input-wrap { position: relative; }
.rev-input-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 1.1rem; pointer-events: none;
}
.rev-input-with-icon { padding-left: 42px !important; }

/* Reverse search — inline loader beside phone */
.rev-progress-inline {
  margin: 10px 0 2px;
  padding: 0;
  border-radius: 14px;
  border: 1px solid transparent;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(8px) scale(0.98);
  transition:
    opacity 0.38s ease,
    transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    max-height 0.45s ease,
    margin 0.35s ease,
    padding 0.35s ease,
    border-color 0.3s ease;
  pointer-events: none;
}
.rev-progress-inline.is-active {
  padding: 14px 15px;
  margin: 12px 0 6px;
  max-height: 140px;
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.14) 0%, rgba(59, 130, 246, 0.04) 55%, rgba(168, 85, 247, 0.06) 100%);
  border-color: rgba(59, 130, 246, 0.32);
  box-shadow: 0 8px 28px rgba(59, 130, 246, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.rev-progress-inline--admin.is-active {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.14) 0%, rgba(239, 68, 68, 0.04) 100%);
  border-color: rgba(239, 68, 68, 0.35);
  box-shadow: 0 8px 28px rgba(239, 68, 68, 0.1);
}
.rev-progress-inline.is-exit {
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  max-height: 0;
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-color: transparent;
}
.rev-progress-row { display: flex; align-items: flex-start; gap: 12px; }
.rev-progress-phone-badge {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #3B82F6, #60A5FA);
  color: #fff;
  font-size: 1.15rem;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.45);
}
.rev-progress-inline--admin .rev-progress-phone-badge {
  background: linear-gradient(135deg, #ef4444, #f87171);
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4);
}
.rev-progress-phone-pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(96, 165, 250, 0.55);
  animation: rev-phone-pulse 1.6s ease-out infinite;
}
.rev-progress-inline--admin .rev-progress-phone-pulse {
  border-color: rgba(248, 113, 113, 0.55);
}
@keyframes rev-phone-pulse {
  0% { transform: scale(0.92); opacity: 0.9; }
  70% { transform: scale(1.18); opacity: 0; }
  100% { transform: scale(1.18); opacity: 0; }
}
.rev-progress-content { flex: 1; min-width: 0; }
.rev-progress-meta { margin-bottom: 10px; }
.rev-progress-phone-num {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}
.rev-progress-step-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 0;
  font-size: 0.78rem;
  color: var(--text-secondary);
  min-height: 1.25rem;
}
.rev-progress-step-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.18);
  color: #93C5FD;
  flex-shrink: 0;
}
.rev-progress-inline--admin .rev-progress-step-icon {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}
.rev-progress-inline.is-complete .rev-progress-step-icon {
  background: rgba(16, 185, 129, 0.2);
  color: #6EE7B7;
}
.rev-progress-step-label { line-height: 1.3; }
.rev-progress-track-wrap { position: relative; }
.rev-progress-track {
  height: 7px;
  background: rgba(0, 0, 0, 0.25);
  position: relative;
}
.rev-progress-fill {
  width: 0%;
  background: linear-gradient(90deg, #3B82F6, #60A5FA, #93C5FD);
  transition: width 0.75s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.45);
}
.rev-progress-inline--admin .rev-progress-fill {
  background: linear-gradient(90deg, #ef4444, #f87171, #fca5a5);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}
.rev-progress-fill.is-full { box-shadow: 0 0 16px rgba(16, 185, 129, 0.35); }
.rev-progress-inline.is-complete .rev-progress-fill {
  background: linear-gradient(90deg, #10B981, #34D399);
}
.rev-progress-fill::after { animation: none; opacity: 0; }
.rev-progress-inline.is-step .rev-progress-fill::after,
.rev-progress-inline.is-complete .rev-progress-fill::after {
  animation: shimmer 1.4s infinite;
  opacity: 1;
}
.rev-progress-indeterminate {
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.rev-progress-inline.is-indeterminate .rev-progress-indeterminate {
  opacity: 1;
}
.rev-progress-inline.is-step .rev-progress-indeterminate,
.rev-progress-inline.is-complete .rev-progress-indeterminate {
  opacity: 0;
}
.rev-progress-indeterminate::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(96, 165, 250, 0.15) 35%,
    rgba(147, 197, 253, 0.55) 50%,
    rgba(96, 165, 250, 0.15) 65%,
    transparent 100%
  );
  animation: rev-indeterminate-sweep 1.35s ease-in-out infinite;
}
.rev-progress-inline--admin .rev-progress-indeterminate::before {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(248, 113, 113, 0.15) 35%,
    rgba(252, 165, 165, 0.55) 50%,
    rgba(248, 113, 113, 0.15) 65%,
    transparent 100%
  );
}
@keyframes rev-indeterminate-sweep {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.rev-progress-dots {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}
.rev-progress-dots--solo {
  margin-top: 12px;
  gap: 8px;
}
.rev-progress-dots--solo .rev-progress-dot {
  height: 7px;
}
.rev-progress-dot {
  flex: 1;
  height: 3px;
  border-radius: 9999px;
  background: rgba(148, 163, 184, 0.18);
  transition: background 0.4s ease, box-shadow 0.35s ease, opacity 0.3s ease;
}
.rev-progress-dot.is-pending { opacity: 0.35; }
.rev-progress-dot.is-pulse {
  opacity: 0.55;
  animation: rev-dot-pulse 1.2s ease-in-out infinite;
}
@keyframes rev-dot-pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.75; }
}
.rev-progress-dot[data-step="1"].is-active,
.rev-progress-dot[data-step="1"].is-done {
  background: linear-gradient(90deg, #2563eb, #60a5fa);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.45);
  opacity: 1;
}
.rev-progress-dot[data-step="2"].is-active,
.rev-progress-dot[data-step="2"].is-done {
  background: linear-gradient(90deg, #7c3aed, #a78bfa);
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.4);
  opacity: 1;
}
.rev-progress-dot[data-step="3"].is-active,
.rev-progress-dot[data-step="3"].is-done {
  background: linear-gradient(90deg, #d97706, #fbbf24);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.35);
  opacity: 1;
}
.rev-progress-dot[data-step="4"].is-active,
.rev-progress-dot[data-step="4"].is-done {
  background: linear-gradient(90deg, #059669, #34d399);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
  opacity: 1;
}
.rev-progress-inline--admin .rev-progress-dot[data-step="1"].is-active,
.rev-progress-inline--admin .rev-progress-dot[data-step="1"].is-done {
  background: linear-gradient(90deg, #dc2626, #f87171);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.45);
}
.rev-progress-inline--admin .rev-progress-dot[data-step="2"].is-active,
.rev-progress-inline--admin .rev-progress-dot[data-step="2"].is-done {
  background: linear-gradient(90deg, #ea580c, #fb923c);
}
.rev-progress-inline--admin .rev-progress-dot[data-step="3"].is-active,
.rev-progress-inline--admin .rev-progress-dot[data-step="3"].is-done {
  background: linear-gradient(90deg, #ca8a04, #fde047);
}
.rev-progress-inline--admin .rev-progress-dot[data-step="4"].is-active,
.rev-progress-inline--admin .rev-progress-dot[data-step="4"].is-done {
  background: linear-gradient(90deg, #16a34a, #4ade80);
}
.rev-progress-inline.is-step:not(.is-step-4) .rev-progress-dot[data-step="4"] {
  opacity: 0.28;
  background: rgba(148, 163, 184, 0.18);
  box-shadow: none;
}
.rev-progress-inline.is-complete .rev-progress-dot.is-done,
.rev-progress-inline.is-complete .rev-progress-dot.is-active,
.rev-progress-inline.is-complete .rev-progress-dot[data-step="4"] {
  background: linear-gradient(90deg, #10b981, #6ee7b7);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.45);
  opacity: 1;
}
.rev-progress-track-wrap,
.rev-progress-track,
.rev-progress-fill,
.rev-progress-indeterminate {
  display: none !important;
}

#reverse-result.rev-result--building,
#admin-reverse-result.rev-result--building {
  opacity: 0.92;
  transition: opacity 0.35s ease;
}

.rev-progress-card .rev-spin,
.rev-progress-inline .rev-spin,
.rev-alt-btn .rev-spin { animation: rev-spin 0.85s linear infinite; }
@keyframes rev-spin { to { transform: rotate(360deg); } }

.rev-others {
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.rev-section-title { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 8px; }
.rev-others-list { list-style: none; margin: 0; padding: 0; }
.rev-others-list li {
  display: flex;
  flex-direction: column;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.rev-others-list li:last-child { border-bottom: none; }
.rev-other-name { font-weight: 500; color: var(--text-primary); }
.rev-other-meta { font-size: 0.75rem; color: var(--text-muted); }

.rev-main-person {
  background: var(--surface-elevated);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 0 32px rgba(59, 130, 246, 0.12);
}
.rev-main-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--accent-reverse-light);
  background: rgba(59, 130, 246, 0.15);
  padding: 4px 10px; border-radius: 6px; margin-bottom: 8px;
}
.rev-owner-head--main { background: linear-gradient(180deg, rgba(59, 130, 246, 0.08) 0%, transparent 100%); }
.rev-owner-top { display: flex; gap: 14px; align-items: flex-start; }
.rev-owner-intro { flex: 1; min-width: 0; }
.rev-owner-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.rev-quick-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border);
}
.rev-stat {
  text-align: center; padding: 8px 4px;
  background: var(--bg-base); border-radius: 10px; border: 1px solid var(--border);
}
.rev-stat i { display: block; font-size: 1rem; color: var(--accent-reverse-light); margin-bottom: 4px; }
.rev-stat strong { display: block; font-size: 1.05rem; font-weight: 700; color: var(--rev-text-value); line-height: 1; }
.rev-stat span { font-size: 0.58rem; color: var(--rev-text-label); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 500; }

.rev-person-head { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.rev-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, #3B82F6, #A855F7);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1rem; flex-shrink: 0; color: #fff;
}
.rev-avatar--sm { width: 40px; height: 40px; font-size: 1rem; }
.rev-avatar--alt { background: linear-gradient(135deg, #F59E0B, #FBBF24); color: #fff; }
.rev-person-name { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); margin: 0; }
.rev-person-sub { font-size: 0.8rem; color: var(--text-secondary); margin-top: 4px; }

.rev-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.rev-cell {
  background: var(--bg-base);
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
}
.rev-cell--wide { grid-column: 1 / -1; }
.rev-cell-k { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 4px; }
.rev-cell-v { font-size: 0.85rem; color: var(--text-primary); line-height: 1.35; word-break: break-word; }
.rev-cell--money .rev-cell-v { color: var(--accent-billing-light); font-weight: 600; }
.rev-mail { color: #60A5FA; display: block; margin-top: 2px; text-decoration: none; }

.rev-more { margin-top: 14px; }
.rev-more-sum { font-size: 0.85rem; color: var(--accent-reverse-light); cursor: pointer; padding: 8px 0; }
.rev-more-body { padding-top: 8px; }
.rev-acc { margin-bottom: 14px; }
.rev-acc-title { font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }
.rev-acc-c { color: var(--text-muted); font-weight: 400; }
.rev-acc ul { list-style: none; margin: 0; padding: 0; font-size: 0.8rem; color: var(--text-secondary); }
.rev-acc li { padding: 8px 0; border-bottom: 1px solid var(--border); line-height: 1.4; }
.rev-acc li:last-child { border-bottom: none; }
.rev-acc-meta { display: block; font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }
.rev-tag {
  display: inline-block;
  font-size: 0.6rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.2);
  color: #60A5FA;
  margin-right: 6px;
  vertical-align: middle;
}
.rev-tag--ok { background: rgba(16, 185, 129, 0.2); color: #34D399; }

/* revarse_phone — OwnerCard / AlternateOwnersPanel */
.rev-owner-card {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 14px;
  overflow: hidden;
  box-shadow: 0 0 24px rgba(59, 130, 246, 0.08);
}
.rev-owner-card:first-of-type {
  border-color: rgba(59, 130, 246, 0.35);
  box-shadow: 0 0 32px rgba(59, 130, 246, 0.12);
}
.rev-owner-card--alt { border-color: var(--border); box-shadow: none; }
.rev-owner-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}
.rev-owner-name { font-size: 1.12rem; font-weight: 700; margin: 8px 0 0; color: var(--rev-text-value); letter-spacing: 0.01em; }
.rev-owner-idx { color: var(--rev-text-label); font-weight: 500; }
.rev-owner-age { font-size: 0.85rem; font-weight: 500; color: var(--rev-text-body); }
.rev-owner-subtitle { font-size: 0.72rem; color: var(--rev-text-label); margin-top: 4px; }
.rev-owner-meta { font-size: 0.8rem; color: var(--rev-text-body); margin-top: 4px; }
.rev-owner-verified {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.72rem; font-weight: 500;
  color: var(--rev-text-success); margin-top: 8px;
}
.rev-owner-verified i { color: #34D399; }
.rev-ft-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  font-size: 0.65rem;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34D399;
}
.rev-owner-body { padding: 12px 14px 14px; font-size: 0.8rem; }
.rev-usage {
  border: 1px solid rgba(59, 130, 246, 0.3);
  background: rgba(59, 130, 246, 0.06);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
}
.rev-usage-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.rev-usage-title { font-size: 0.75rem; font-weight: 600; color: var(--accent-reverse-light); display: flex; align-items: center; gap: 6px; }
.rev-usage-text, .rev-usage-hint { display: flex; align-items: flex-start; gap: 6px; }
.rev-usage-text i, .rev-usage-hint i { flex-shrink: 0; margin-top: 2px; opacity: 0.7; }
.rev-tenure {
  font-size: 0.6rem; font-weight: 600;
  padding: 3px 8px; border-radius: 6px; border: 1px solid var(--border);
  display: inline-flex; align-items: center; gap: 4px;
}
.rev-tenure--muted { color: var(--text-muted); }
.rev-tenure--warn { border-color: rgba(251, 191, 36, 0.4); color: #FBBF24; }
.rev-tenure--ok { border-color: rgba(96, 165, 250, 0.4); color: #60A5FA; }
.rev-tenure--good { border-color: rgba(52, 211, 153, 0.4); color: #34D399; }
.rev-tenure--great { border-color: rgba(16, 185, 129, 0.5); color: #6EE7B7; }
.rev-usage-text { font-family: ui-monospace, Consolas, monospace; font-size: 0.78rem; line-height: 1.5; color: var(--rev-text-value); }
.rev-usage-text i { color: var(--accent-reverse-light); opacity: 1; }
.rev-usage-hint { font-size: 0.7rem; color: var(--rev-text-label); margin-top: 6px; line-height: 1.45; }
.rev-usage-hint i { color: var(--rev-text-label); opacity: 0.9; }
.rev-block { margin-bottom: 12px; }
.rev-block-title { font-size: 0.75rem; font-weight: 600; margin-bottom: 10px; color: var(--text-primary); display: flex; align-items: center; gap: 8px; }
.rev-block-title .rev-icon-wrap { margin-right: 0; }
.rev-block-count { margin-left: auto; font-size: 0.65rem; color: var(--text-muted); font-weight: 500; }
.rev-summary { color: var(--rev-text-body); line-height: 1.5; font-size: 0.8rem; }
.rev-addr-current {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--bg-base); border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 10px; padding: 12px;
}
.rev-addr-icon {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(59, 130, 246, 0.15); color: var(--accent-reverse-light); font-size: 1.1rem;
}
.rev-addr-body { flex: 1; min-width: 0; }
.rev-addr-line { font-weight: 500; color: var(--text-primary); line-height: 1.35; }
.rev-addr-label { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--rev-text-accent); font-weight: 600; margin-bottom: 4px; display: flex; align-items: center; gap: 4px; }
.rev-addr-meta { display: flex; align-items: center; gap: 5px; font-size: 0.75rem; color: var(--rev-text-body); margin-top: 4px; }
.rev-addr-meta i { color: var(--rev-text-label); }
.rev-addr-extra { display: flex; align-items: center; gap: 5px; font-size: 0.78rem; font-weight: 600; color: var(--rev-text-gold); margin-top: 4px; }
.rev-addr-extra i { color: var(--accent-billing-light); }
.rev-list-icon {
  width: 24px; height: 24px; border-radius: 6px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(59, 130, 246, 0.12); color: var(--accent-reverse-light); font-size: 0.75rem;
}
.rev-addr-list li { display: flex; gap: 10px; }
.rev-addr-list { list-style: none; margin: 0; padding: 0; }
.rev-addr-list li { display: flex; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); line-height: 1.35; }
.rev-addr-list li:last-child { border-bottom: none; }
.rev-collapse {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  margin-bottom: 8px;
}
.rev-collapse-sum {
  list-style: none; cursor: pointer; padding: 10px 12px;
  font-size: 0.75rem; font-weight: 600;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.rev-collapse-label { display: flex; align-items: center; gap: 8px; }
.rev-collapse-sum::-webkit-details-marker { display: none; }
.rev-collapse[open] .rev-collapse-icon { transform: rotate(180deg); }
.rev-collapse-icon { font-size: 1rem; color: var(--text-muted); transition: transform 0.15s; }
.rev-collapse-c { font-weight: 600; color: var(--rev-text-accent); }
.rev-collapse-sum { color: var(--rev-text-value); }
.rev-collapse-body { border-top: 1px solid var(--border); padding: 10px 12px; }
.rev-phone-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; }
.rev-phone-table { width: 100%; font-size: 0.7rem; border-collapse: collapse; }
.rev-phone-table th {
  text-align: left; padding: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--rev-text-label); font-size: 0.6rem;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.rev-phone-table th i { margin-right: 4px; vertical-align: -2px; color: var(--accent-reverse-light); }
.rev-phone-table td { padding: 8px; border-top: 1px solid var(--border); vertical-align: top; color: var(--rev-text-body); }
.rev-phone-td-num { font-weight: 600; color: var(--rev-text-value); }
.rev-phone-table td:last-child { color: var(--rev-text-label); }
.rev-td-icon { margin-right: 4px; color: var(--accent-reverse-light); vertical-align: -2px; }
.rev-email-list { list-style: none; margin: 0; padding: 0; font-size: 0.75rem; }
.rev-email-list li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.rev-email-list li:last-child { border-bottom: none; }
.rev-email-list i { color: var(--accent-reverse-light); }
.rev-email-list a { color: #93C5FD; text-decoration: none; font-family: ui-monospace, Consolas, monospace; font-size: 0.78rem; font-weight: 500; }
.rev-prop-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rev-prop-card {
  display: flex; flex-direction: column; gap: 4px;
  padding: 10px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg-base);
}
.rev-prop-icon { color: var(--accent-billing-light); font-size: 1rem; }
.rev-prop-k { font-size: 0.62rem; color: var(--rev-text-label); text-transform: uppercase; letter-spacing: 0.03em; }
.rev-prop-v { font-size: 0.85rem; font-weight: 700; color: var(--rev-text-gold); }
.rev-scroll-list { list-style: none; margin: 0; padding: 0; max-height: 160px; overflow-y: auto; font-size: 0.75rem; }
.rev-icon-list li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); color: var(--rev-text-body); }
.rev-icon-list li i { color: var(--accent-reverse-light); flex-shrink: 0; opacity: 0.95; }
.rev-icon-list li:last-child { border-bottom: none; }
.rev-scroll-list li { padding: 6px 0; border-bottom: 1px solid var(--border); color: var(--rev-text-body); }
.rev-scroll-list li:last-child { border-bottom: none; }
.rev-simple-list { list-style: none; margin: 0; padding: 0; color: var(--rev-text-body); }
.rev-simple-list li { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.rev-simple-list li i { color: var(--accent-reverse-light); }
.rev-empty { color: var(--rev-text-label); font-size: 0.78rem; display: flex; align-items: center; gap: 6px; }
.rev-meta-line {
  display: flex; align-items: center; flex-wrap: wrap; gap: 5px 8px;
  font-size: 0.8rem; margin-top: 6px; line-height: 1.35;
}
.rev-meta-line i {
  font-size: 0.95rem; flex-shrink: 0;
  color: var(--accent-reverse-light);
  width: 18px; text-align: center;
}
.rev-meta-k { color: var(--rev-text-label); font-weight: 500; }
.rev-meta-v { color: var(--rev-text-body); font-weight: 500; }
.rev-meta-line--primary .rev-meta-v { color: var(--rev-text-value); font-weight: 600; }
.rev-meta-line--primary i { color: #7DD3FC; }
.rev-alias-line { display: flex; align-items: flex-start; gap: 6px; color: var(--rev-text-body); }
.rev-summary i { opacity: 0.6; margin-right: 4px; }
.rev-alert { border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; font-size: 0.8rem; }
.rev-alert--warn { border: 1px solid rgba(251, 191, 36, 0.4); background: rgba(251, 191, 36, 0.08); }
.rev-alt-panel {
  border: 1px solid rgba(251, 191, 36, 0.4);
  border-radius: 14px; padding: 14px 16px; margin-top: 4px;
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.1) 0%, rgba(251, 191, 36, 0.02) 100%);
}
.rev-alt-panel .rev-meta-line i { color: #FBBF24; }
.rev-alt-panel .rev-meta-line--primary .rev-meta-v { color: #FEF3C7; }
.rev-alt-panel .rev-meta-k { color: #D4A574; }
.rev-alt-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.rev-alt-title { font-size: 0.95rem; font-weight: 700; margin: 0 0 4px; color: var(--rev-text-value); }
.rev-alt-desc { font-size: 0.72rem; color: var(--rev-text-label); line-height: 1.45; margin: 0; display: flex; align-items: center; gap: 5px; }
.rev-alt-desc i { color: var(--rev-text-gold); }
.rev-alt-row {
  border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 12px; background: var(--bg-base);
}
.rev-alt-row:last-child { margin-bottom: 0; }
.rev-alt-row-inner { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; }
.rev-alt-row-main { flex: 1; min-width: 160px; }
.rev-alt-name { font-weight: 700; font-size: 0.95rem; margin-bottom: 4px; color: var(--rev-text-value); }
.rev-alt-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid rgba(251, 191, 36, 0.4); border-radius: 10px;
  padding: 10px 16px; font-size: 0.8rem; font-weight: 500;
  background: rgba(251, 191, 36, 0.1); color: #FCD34D;
  flex-shrink: 0;
}
.rev-alt-expanded { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border); }
.rev-alt-expanded-label { font-size: 0.72rem; color: var(--rev-text-label); margin-bottom: 10px; display: flex; align-items: center; gap: 6px; font-weight: 500; }
.rev-alt-expanded-label i { color: var(--rev-text-gold); }
.rev-alt-btn:disabled { opacity: 0.85; pointer-events: none; }
.rev-alt-btn--loading {
  min-width: 7.5rem;
  background: rgba(251, 191, 36, 0.16);
  border-color: rgba(251, 191, 36, 0.55);
}
.rev-alt-btn--loading .ti-loader-2 { font-size: 1.1rem; }
.rev-alert p { display: flex; align-items: flex-start; gap: 8px; margin: 0; }
.rev-alert p i { flex-shrink: 0; margin-top: 2px; }

@media (max-width: 380px) {
  .rev-quick-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 480px) {
  .rev-grid { grid-template-columns: 1fr 1fr; }
  .rev-alt-row-inner { flex-wrap: nowrap; align-items: center; }
  .rev-alt-btn { margin-left: auto; }
}
.quick-paste {
  min-height: 88px;
  font-size: 0.8rem;
  font-family: ui-monospace, Consolas, monospace;
}

/* Forms with icons + i18n */
.lh-form-card { padding: 16px; }
.lh-form-head {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.lh-field { margin-bottom: 12px; }
.lh-field:last-child { margin-bottom: 0; }
.lh-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.8rem; font-weight: 500;
  color: var(--rev-text-body, var(--text-secondary));
  margin-bottom: 6px;
}
.lh-label i { font-size: 0.95rem; color: var(--accent-reverse-light); opacity: 0.95; }
.lh-field--ssn .lh-label i { color: var(--accent-ssn-light); }
.lh-field--score .lh-label i { color: var(--accent-scoring-light); }
.lh-field--bill .lh-label i { color: var(--accent-billing-light); }
.lh-input-wrap { position: relative; }
.lh-input-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--rev-text-label, var(--text-muted));
  font-size: 1rem; pointer-events: none; z-index: 1;
}
.lh-input-with-icon { padding-left: 38px !important; }
.lh-check {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.8rem; color: var(--rev-text-body, var(--text-secondary));
  cursor: pointer;
}
.lh-check i { color: var(--accent-ssn-light); }

/* Custom checkbox / radio (hide native control) */
.lh-control {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 0.8rem; color: var(--rev-text-body, var(--text-secondary));
  cursor: pointer; user-select: none;
}
.lh-control input {
  position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none;
}
.lh-control-ui {
  flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px;
  border: 2px solid rgba(148, 163, 184, 0.55);
  background: rgba(15, 23, 42, 0.5);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.lh-check.lh-control .lh-control-ui { border-radius: 5px; }
.lh-radio.lh-control .lh-control-ui { border-radius: 50%; }
.lh-control input:checked + .lh-control-ui {
  border-color: var(--accent-reverse-light, #60a5fa);
  background: rgba(59, 130, 246, 0.35);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}
.lh-radio.lh-control input:checked + .lh-control-ui::after {
  content: ''; display: block; width: 8px; height: 8px; margin: 3px auto 0;
  border-radius: 50%; background: #93c5fd;
}
.lh-check.lh-control input:checked + .lh-control-ui::after {
  content: ''; display: block; width: 5px; height: 9px; margin: 1px auto 0;
  border: solid #93c5fd; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.lh-radio-group { display: flex; flex-direction: column; gap: 10px; }
.lh-radio-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lh-radio-title { font-weight: 600; color: var(--text-primary); font-size: 0.82rem; }
.lh-radio-desc { font-size: 0.72rem; color: var(--text-muted); line-height: 1.35; }
.admin-rev-options .lh-check.lh-control { margin-bottom: 4px; }

.lang-picker {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
}
@media (min-width: 400px) {
  .lang-picker { grid-template-columns: repeat(3, 1fr); }
}
.lang-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-base);
  color: var(--text-secondary);
  font-size: 0.75rem; font-weight: 500;
  cursor: pointer; transition: border-color 0.15s, background 0.15s;
  text-align: left;
}
.lang-btn:hover { border-color: rgba(59, 130, 246, 0.4); color: var(--text-primary); }
.lang-btn--active {
  border-color: rgba(59, 130, 246, 0.55);
  background: rgba(59, 130, 246, 0.12);
  color: var(--accent-reverse-light);
  font-weight: 600;
}
.lang-btn-flag {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  line-height: 0;
}
.lang-flag-svg {
  width: 22px;
  height: 14px;
  border-radius: 2px;
  display: block;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* Auth gate (access key + PIN) */
.auth-gate {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: var(--bg-base, #0A0B14);
}
.auth-gate.hidden { display: none !important; }

/* Telegram Mini App: allow full vertical scroll on auth screens. */
body.tg-app .auth-gate {
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding-top: calc(var(--safe-top, 0px) + 16px);
  padding-bottom: calc(var(--safe-bottom, 0px) + 24px);
}

/* Shared hide helper (channel gate, API page, modals) */
.is-hidden {
  display: none !important;
}

/* Telegram channel subscription gate */
.channel-gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(10, 11, 20, 0.94);
  backdrop-filter: blur(8px);
}
.channel-gate-card {
  width: 100%;
  max-width: 400px;
  padding: 24px 20px;
  border-radius: 16px;
  border: 1px solid rgba(59, 130, 246, 0.35);
  background: linear-gradient(160deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}
.channel-gate-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.35);
}
.channel-gate-title {
  text-align: center;
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 8px;
}
.channel-gate-text {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0 0 16px;
}
.channel-gate-tgid {
  text-align: center;
  font-size: 0.75rem;
  font-family: ui-monospace, monospace;
  color: #86efac;
  margin: 0 0 12px;
}
.channel-gate-link-panel {
  margin-bottom: 14px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(55, 65, 81, 0.5);
}
.channel-gate-sub {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  margin-bottom: 0;
}
.channel-gate-status {
  margin-top: 12px;
  font-size: 0.75rem;
  color: #93c5fd;
  text-align: center;
  min-height: 0;
}
.channel-gate-status:not(:empty) {
  min-height: 1.2em;
}
.channel-gate-error {
  margin-top: 8px;
  font-size: 0.75rem;
  color: #fca5a5;
  text-align: center;
  min-height: 0;
}
.channel-gate-error:not(:empty) {
  min-height: 1.2em;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 28px 24px;
  border-radius: 16px;
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  background: var(--bg-card, #12141f);
  box-shadow: 0 24px 48px rgba(0,0,0,0.35);
}
.auth-brand {
  display: flex;
  justify-content: center;
  width: 100%;
  margin: 0 0 18px;
  padding: 4px 0;
  text-decoration: none;
}
.auth-brand .lh-logo-mark {
  width: 40px;
  height: 40px;
}
.auth-brand .lh-logo-word {
  font-size: 1.15rem;
}
.auth-card .auth-sub { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 20px; }
.auth-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.auth-tab {
  flex: 1; padding: 10px; border-radius: 10px; border: 1px solid var(--border);
  background: transparent; color: var(--text-secondary); font-weight: 600; font-size: 0.85rem;
  cursor: pointer;
}
.auth-tab.active { border-color: rgba(59,130,246,0.5); background: rgba(59,130,246,0.12); color: #60A5FA; }
.auth-key-reveal {
  margin: 16px 0; padding: 14px; border-radius: 12px;
  background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.35);
}
.auth-key-reveal-label {
  margin: 0 0 8px; font-size: 0.75rem; font-weight: 600; color: #6ee7b7;
}
.auth-key-reveal-row {
  display: flex; gap: 8px; align-items: stretch;
}
.auth-key-reveal-input {
  flex: 1; min-width: 0; font-size: 0.75rem; color: #34d399;
  user-select: all; -webkit-user-select: all;
}
.auth-key-copy-btn {
  flex-shrink: 0; padding: 0 14px; border-radius: 10px;
  border: 1px solid rgba(16, 185, 129, 0.45); background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7; font-size: 0.8rem; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
}
.channel-gate-link-panel input:disabled {
  opacity: 0.85; cursor: not-allowed;
}
.input-readonly {
  opacity: 0.9;
  cursor: default;
}
.auth-error { color: #f87171; font-size: 0.8rem; margin-top: 8px; min-height: 1.2em; }
#app-root.hidden { display: none !important; }

/* History — tap row / eye / copy phone */
.hist-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(96, 165, 250, 0.35);
  background: rgba(59, 130, 246, 0.1);
  color: #93c5fd;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.hist-icon-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(147, 197, 253, 0.55);
  color: #bfdbfe;
}
.hist-copy-phone {
  border-color: rgba(148, 163, 184, 0.35);
  background: rgba(148, 163, 184, 0.08);
  color: #94a3b8;
}
.hist-copy-phone:hover {
  background: rgba(148, 163, 184, 0.16);
  color: #cbd5e1;
}
.hist-cell-input {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.hist-cell-input-text { line-height: 1.35; }
.hist-tap-open {
  cursor: pointer;
  transition: color 0.15s ease;
}
.hist-tap-open:hover { color: #93c5fd; }
tr.hist-row-open { cursor: pointer; }
tr.hist-row-open:hover td {
  background: rgba(59, 130, 246, 0.06);
}
.hist-card-open { cursor: pointer; }
.hist-card-open:hover {
  border-color: rgba(59, 130, 246, 0.35);
}
.hist-actions-cell,
.hist-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.hist-card-actions { flex-wrap: wrap; }

/* History — rich entry cards */
.hist-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hist-entry {
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.14);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.hist-entry--compact {
  padding: 10px 12px;
  border-radius: 12px;
}
.hist-entry--open {
  cursor: pointer;
}
.hist-entry--open:hover {
  border-color: rgba(59, 130, 246, 0.4);
  background: rgba(30, 41, 59, 0.75);
}
.hist-entry-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.hist-entry-head--compact {
  align-items: center;
  margin-bottom: 6px;
  gap: 6px;
}
.hist-entry-head-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.hist-entry-head--compact .hist-entry-head-left {
  gap: 6px;
  font-size: 0.75rem;
}
.hist-entry-head-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}
.hist-entry-head--compact .hist-entry-head-right {
  flex-direction: row;
  align-items: center;
  gap: 4px;
}
.hist-entry-date {
  font-size: 0.78rem;
  color: var(--text-muted, #94a3b8);
}
.hist-entry-head--compact .hist-entry-date {
  font-size: 0.7rem;
}
.hist-entry-total {
  font-size: 1rem;
  font-weight: 700;
  color: #fbbf24;
  font-variant-numeric: tabular-nums;
}
.hist-entry-head--compact .hist-entry-total {
  font-size: 0.82rem;
  font-weight: 700;
}
.hist-entry-phone {
  margin-bottom: 10px;
  font-size: 1.05rem;
  font-weight: 600;
}
.hist-entry-phone--compact {
  margin-bottom: 6px;
  font-size: 0.92rem;
}
.hist-entry-phone--compact .hist-cell-input-text {
  font-size: 0.92rem;
}
.hist-entry-block {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
}
.hist-entry-block--compact {
  margin-top: 6px;
  padding-top: 6px;
}
.hist-entry-block-title {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
}
.hist-entry-block--compact .hist-entry-block-title {
  margin: 0 0 5px;
  font-size: 0.65rem;
  flex-wrap: wrap;
  gap: 4px;
}
.hist-people-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: flex-start;
}
.hist-person-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 3px 7px;
  border-radius: 8px;
  font-size: 0.68rem;
  line-height: 1.25;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.14);
  vertical-align: top;
}
.hist-person-chip--fico {
  border-color: rgba(16, 185, 129, 0.35);
}
.hist-person-chip--fico .hist-person-st {
  color: #6ee7b7;
  font-weight: 700;
}
.hist-person-chip--outcome {
  border-color: rgba(56, 189, 248, 0.3);
}
.hist-person-chip--outcome .hist-person-st {
  color: #7dd3fc;
  font-weight: 600;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hist-person-chip--fail .hist-person-st {
  color: #f87171;
}
.hist-person-chip--pending .hist-person-st {
  color: #fbbf24;
}
.hist-person-chip--plain {
  border-color: rgba(148, 163, 184, 0.12);
}
.hist-person-chip--plain .hist-person-name {
  color: #cbd5e1;
}
.hist-person-chip--bundle {
  color: #94a3b8;
  border-style: dashed;
  font-size: 0.65rem;
}
.hist-tag-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  font-size: 0.58rem;
  font-weight: 800;
  flex-shrink: 0;
}
.hist-tag-mini--primary {
  background: rgba(59, 130, 246, 0.25);
  color: #93c5fd;
}
.hist-tag-mini--alt {
  background: rgba(168, 85, 247, 0.2);
  color: #d8b4fe;
}
.hist-person-name {
  max-width: 88px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: #e2e8f0;
}
.hist-person-st {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.hist-icon-btn--sm {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}
.hist-icon-btn--sm .ti {
  font-size: 0.85rem;
}
.hist-profiles {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hist-profile-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
}
.hist-profile-name {
  font-weight: 600;
  color: #e2e8f0;
}
.hist-tag {
  display: inline-flex;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}
.hist-tag--primary {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
}
.hist-tag--alt {
  background: rgba(168, 85, 247, 0.15);
  color: #d8b4fe;
}
.hist-tag--score {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
}
.hist-tag--ssn {
  background: rgba(251, 191, 36, 0.12);
  color: #fcd34d;
}
.hist-family-hint {
  margin: 0;
  font-size: 0.62rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: #64748b;
}
.hist-entry-costs--compact {
  margin-top: 6px;
  padding-top: 6px;
  gap: 4px;
}
.hist-entry-costs--compact .hist-cost-chip {
  padding: 2px 6px;
  font-size: 0.65rem;
  border-radius: 6px;
}
.hist-profile-empty {
  margin: 0;
  font-size: 0.78rem;
}
.hist-action-label {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 600;
  color: #e2e8f0;
}
.hist-action-parent {
  margin: 0 0 8px;
  font-size: 0.82rem;
}
.hist-entry--action {
  border-left: 3px solid rgba(148, 163, 184, 0.25);
  padding: 10px 12px;
}
.hist-entry--action .hist-entry-head {
  margin-bottom: 4px;
}
.hist-entry--action .hist-action-label {
  font-size: 0.88rem;
  margin-bottom: 4px;
}
.hist-entry--action .hist-action-parent {
  font-size: 0.72rem;
  margin-bottom: 4px;
}
.hist-entry--action .hist-entry-result {
  font-size: 0.75rem;
  margin: 0 0 4px;
}
.hist-entry--action .hist-entry-actions {
  margin-top: 6px;
  padding-top: 6px;
}
.hist-entry--action.hist-entry--open:hover {
  border-left-color: rgba(59, 130, 246, 0.55);
}
.hist-scoring-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hist-scoring-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.35);
  border: 1px solid rgba(148, 163, 184, 0.08);
}
.hist-scoring-who {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #cbd5e1;
  min-width: 0;
}
.hist-scoring-result {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  text-align: right;
  max-width: 100%;
}
.hist-sc-result {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  font-weight: 600;
  max-width: 280px;
  line-height: 1.3;
}
.hist-sc-result--fico {
  color: #6ee7b7;
}
.hist-sc-result--outcome {
  color: #7dd3fc;
}
.hist-sc-result--fail {
  color: #f87171;
}
.hist-sc-result--pending {
  color: #fbbf24;
}
.hist-sc-result--none {
  color: #64748b;
  font-weight: 500;
}
.hist-sc-cost {
  font-size: 0.72rem;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}
.hist-sc-cost--refund {
  color: #64748b;
  font-style: italic;
}
.hist-entry-costs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(148, 163, 184, 0.12);
}
.hist-entry-costs-label {
  width: 100%;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-bottom: 2px;
}
.hist-cost-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 0.72rem;
  background: rgba(30, 41, 59, 0.8);
  color: #cbd5e1;
  font-variant-numeric: tabular-nums;
}
.hist-cost-chip--reverse { border: 1px solid rgba(59, 130, 246, 0.25); }
.hist-cost-chip--score { border: 1px solid rgba(16, 185, 129, 0.25); }
.hist-cost-chip--ftn { border: 1px solid rgba(168, 85, 247, 0.25); }
.hist-entry-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
}
.hist-entry-result {
  margin: 8px 0 0;
  font-size: 0.88rem;
  color: #94a3b8;
}
.hist-empty {
  margin: 0;
  font-size: 0.88rem;
}

.rev-owner-head-actions {
  margin-top: 12px;
  padding-top: 0;
  border-top: none;
}
.rev-owner-head-actions .rev-quick-actions {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.lh-dob-hint {
  margin: 6px 0 0;
  font-size: 0.72rem;
  line-height: 1.35;
  color: rgba(251, 191, 36, 0.92);
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.lh-dob-hint.hidden {
  display: none;
}
.lh-input--dob-approx {
  border-color: rgba(251, 191, 36, 0.45);
}
.rev-score-failed-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.rev-score-failed {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: rgba(248, 113, 113, 0.95);
}
.rev-quick-btn--retry {
  flex-shrink: 0;
}
.admin-scoring-live-wrap {
  background: rgba(15, 23, 42, 0.85);
  border-radius: 10px;
  overflow: auto;
  min-height: 280px;
  max-height: min(560px, 62vh);
}
.admin-scoring-frame {
  display: block;
  width: 100%;
  max-height: min(520px, 58vh);
  min-height: 240px;
  object-fit: contain;
  object-position: top center;
  background: #0f172a;
}
.admin-scoring-frame:not([src]) {
  min-height: 240px;
  opacity: 0.35;
}
.rev-quick-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed rgba(148, 163, 184, 0.22);
}
.rev-owner-head--main .rev-owner-head-actions .rev-quick-btn {
  padding: 8px 12px;
  font-size: 0.75rem;
}
.rev-quick-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.rev-quick-btn--score {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(52, 211, 153, 0.35);
  color: #6ee7b7;
}
.rev-quick-btn--score:hover { background: rgba(16, 185, 129, 0.2); }
.rev-quick-btn--ssn {
  background: rgba(168, 85, 247, 0.1);
  border-color: rgba(192, 132, 252, 0.35);
  color: #d8b4fe;
}
.rev-quick-btn--sm {
  padding: 8px 10px;
  min-width: 36px;
  justify-content: center;
}
.rev-ssn-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 0.65rem;
  background: rgba(168, 85, 247, 0.14);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #e9d5ff;
  font-size: 0.8rem;
}
.rev-ssn-badge-value {
  font-weight: 600;
  letter-spacing: 0.02em;
}
.rev-ssn-badge-sep {
  opacity: 0.55;
  margin: 0 0.1rem;
}
.rev-ssn-pending {
  font-size: 0.8rem;
  color: var(--text-muted, #9ca3af);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.rev-score-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(5, 150, 105, 0.08));
  border: 1px solid rgba(52, 211, 153, 0.4);
}
.rev-score-badge-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: #6ee7b7;
  font-variant-numeric: tabular-nums;
}
.rev-score-pending {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: #93c5fd;
}
.rev-score-pending .rev-spin,
.rev-ssn-pending .rev-spin {
  animation: rev-spin 0.85s linear infinite;
}
.rev-score-outcome-wrap {
  display: inline-flex;
  max-width: 100%;
}
.rev-quick-btn--loading {
  opacity: 0.65;
  pointer-events: none;
}
.rev-quick-btn--loading .ti:first-child {
  animation: rev-spin 0.85s linear infinite;
}
.dash-recent-score {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 22px;
}
.list-card--tap {
  cursor: pointer;
}
.list-card--tap:active {
  opacity: 0.92;
}
.hist-fico-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.15);
  margin-right: 4px;
}
.hist-fico-pending { color: #93c5fd; margin-right: 6px; }
.hist-fico-outcome {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.12);
  margin-right: 4px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rev-score-outcome {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  max-width: 100%;
}
.rev-score-outcome-text {
  overflow: hidden;
  text-overflow: ellipsis;
}
.hist-icon-btn--score {
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(16, 185, 129, 0.1);
  color: #6ee7b7;
}

.rev-result-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0.75rem 0 0.25rem;
  padding: 0.5rem 0;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}
.lh-copy-btn,
.lh-fav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(30, 41, 59, 0.65);
  color: var(--text-primary, #e2e8f0);
}
.lh-copy-btn--sm,
.lh-fav-btn.lh-fav-btn--sm {
  padding: 0.35rem 0.5rem;
  min-width: 2.25rem;
}
.lh-copy-btn:active,
.lh-fav-btn:active {
  opacity: 0.85;
}
.lh-fav-btn.is-on {
  border-color: rgba(244, 63, 94, 0.45);
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
}
.lh-fav-btn.is-on .ti-heart {
  fill: currentColor;
}
.hist-fav-btn {
  margin-right: 0.25rem;
}
.hist-fav-btn.is-on {
  color: #fb7185;
  border-color: rgba(244, 63, 94, 0.4);
}
