/* ==========================================================================
   AnTâm VN — Institutional Pitch Black × Electric Sapphire Blue Design System
   Dark Mode: Matte Obsidian Black × Sapphire Blue (#080A0E / #12151C / #38BDF8)
   Light Mode: Precision Porcelain × Royal Sapphire (#F6F8FB / #FFFFFF / #1D4ED8)
   ========================================================================== */

:root,
[data-theme="dark"] {
  --bg-page: #080a0e;
  --bg-ambient-1: rgba(37, 99, 235, 0.13);
  --bg-ambient-2: rgba(14, 165, 233, 0.085);
  --bg-grid-dot: rgba(226, 232, 240, 0.042);

  --surface: rgba(17, 20, 27, 0.93);
  --surface-solid: #11141b;
  --surface-elevated: #171b24;
  --surface-soft: rgba(23, 27, 36, 0.88);
  --sidebar-bg: rgba(10, 12, 17, 0.96);
  --hover-bg: rgba(56, 189, 248, 0.08);

  --border: rgba(148, 163, 184, 0.17);
  --border-soft: rgba(51, 65, 85, 0.48);
  --border-glow: rgba(56, 189, 248, 0.55);
  --specular: inset 0 1px 0 rgba(255, 255, 255, 0.055);

  --ink: #f1f5f9;
  --ink-secondary: #cbd5e1;
  --muted: #8492a6;

  --accent: #38bdf8;
  --accent-light: #7dd3fc;
  --accent-strong: #2563eb;
  --accent-ink: #ffffff;
  --accent-grad: linear-gradient(135deg, #0ea5e9 0%, #2563eb 58%, #1d4ed8 100%);
  --accent-glow: 0 8px 26px rgba(37, 99, 235, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.24);
  --prism-grad: linear-gradient(135deg, #38bdf8 0%, #2563eb 54%, #06b6d4 100%);

  --btn-sec-bg: rgba(30, 36, 48, 0.9);
  --btn-sec-hover: rgba(41, 50, 66, 0.96);
  --btn-sec-ink: #f1f5f9;

  --input-bg: #0c0f15;
  --input-focus-bg: #10141d;
  --pill-search-bg: #151922;

  --safe: #0ecb81;
  --safe-bg: rgba(14, 203, 129, 0.11);
  --safe-border: rgba(14, 203, 129, 0.34);

  --danger: #f6465d;
  --danger-solid: #f6465d;
  --danger-bg: rgba(246, 70, 93, 0.11);
  --danger-border: rgba(246, 70, 93, 0.34);

  --warn: #60a5fa;
  --warn-bg: rgba(59, 130, 246, 0.11);
  --warn-border: rgba(59, 130, 246, 0.34);

  --purple: #93c5fd;
  --purple-bg: rgba(37, 99, 235, 0.16);
  --purple-border: rgba(56, 189, 248, 0.36);

  --info-bg: rgba(14, 165, 233, 0.11);
  --info-border: rgba(56, 189, 248, 0.32);
  --info-ink: #7dd3fc;

  --banner-bg: linear-gradient(135deg, #11141b 0%, #0a0d14 100%);
  --banner-ink: #f1f5f9;
  --banner-sub: #8492a6;
  --avatar-ring-gap: #11141b;
  --modal-backdrop: rgba(3, 5, 8, 0.84);
  --card-shadow: 0 14px 38px rgba(0, 0, 0, 0.5);
  --spotlight: rgba(56, 189, 248, 0.11);

  --ig-blue: #38bdf8;
  --ig-border: rgba(148, 163, 184, 0.17);
  --ig-border-soft: rgba(51, 65, 85, 0.48);
  --ig-red-bg: rgba(246, 70, 93, 0.12);
  --sidebar-w: 252px;
}

[data-theme="light"] {
  --bg-page: #f4f7fb;
  --bg-ambient-1: rgba(37, 99, 235, 0.08);
  --bg-ambient-2: rgba(14, 165, 233, 0.07);
  --bg-grid-dot: rgba(15, 23, 42, 0.045);

  --surface: rgba(255, 255, 255, 0.96);
  --surface-solid: #ffffff;
  --surface-elevated: #ffffff;
  --surface-soft: #f1f5f9;
  --sidebar-bg: rgba(255, 255, 255, 0.96);
  --hover-bg: rgba(37, 99, 235, 0.07);

  --border: #dfe6f0;
  --border-soft: #ecf1f7;
  --border-glow: rgba(37, 99, 235, 0.45);
  --specular: inset 0 1px 0 rgba(255, 255, 255, 0.95);

  --ink: #0b0e14;
  --ink-secondary: #334155;
  --muted: #64748b;

  --accent: #0284c7;
  --accent-light: #38bdf8;
  --accent-strong: #1d4ed8;
  --accent-ink: #ffffff;
  --accent-grad: linear-gradient(135deg, #0ea5e9 0%, #2563eb 60%, #1d4ed8 100%);
  --accent-glow: 0 6px 20px rgba(37, 99, 235, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  --prism-grad: linear-gradient(135deg, #0ea5e9 0%, #2563eb 55%, #06b6d4 100%);

  --btn-sec-bg: #eef2f7;
  --btn-sec-hover: #e2e8f2;
  --btn-sec-ink: #0b0e14;

  --input-bg: #f8fafc;
  --input-focus-bg: #ffffff;
  --pill-search-bg: #eef2f7;

  --safe: #03a66d;
  --safe-bg: #ebf9f3;
  --safe-border: #a7ebd0;

  --danger: #cf304a;
  --danger-solid: #cf304a;
  --danger-bg: #fef1f3;
  --danger-border: #f8c5ce;

  --warn: #1d4ed8;
  --warn-bg: #eff6ff;
  --warn-border: #bfdbfe;

  --purple: #1d4ed8;
  --purple-bg: #eff6ff;
  --purple-border: #bfdbfe;

  --info-bg: #f0f9ff;
  --info-border: #bae6fd;
  --info-ink: #0369a1;

  --banner-bg: linear-gradient(135deg, #0b0e14 0%, #172030 100%);
  --banner-ink: #f8fafc;
  --banner-sub: #94a3b8;
  --avatar-ring-gap: #ffffff;
  --modal-backdrop: rgba(8, 10, 14, 0.6);
  --card-shadow: 0 6px 24px rgba(15, 23, 42, 0.06);
  --spotlight: rgba(37, 99, 235, 0.07);

  --ig-blue: #0284c7;
  --ig-border: #dfe6f0;
  --ig-border-soft: #ecf1f7;
  --ig-red-bg: #fef1f3;
  --sidebar-w: 252px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: clip;
  scroll-behavior: smooth;
}

button, a, input, select, textarea, [role="button"] {
  touch-action: manipulation;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(132, 146, 166, 0.28); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(56, 189, 248, 0.58); }

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, sans-serif;
  --font-mono: "SF Mono", "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: clip;
  font-family: var(--font-sans);
  font-optical-sizing: auto;
  letter-spacing: -0.011em;
  background-color: var(--bg-page);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11", "ss01";
  transition: background-color 0.25s ease, color 0.25s ease;
}

h1, h2, h3, h4, .ig-wordmark, .ig-auth-logo {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  letter-spacing: -0.025em;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* GPU-composited ambient backdrop (loại bỏ giật cuộn background-attachment: fixed trên iOS/iPadOS Safari) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(960px 520px at 14% -8%, var(--bg-ambient-1), transparent 58%),
    radial-gradient(760px 440px at 88% 4%, var(--bg-ambient-2), transparent 54%),
    radial-gradient(var(--bg-grid-dot) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 26px 26px;
}

/* Institutional Live Ticker Strip (Binance Pro Header Bar) */
.bn-live-bar {
  position: sticky;
  top: 0;
  z-index: 32;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 26px;
  background: var(--sidebar-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-soft);
  font-size: 0.75rem;
  color: var(--muted);
  overflow-x: auto;
}
.bn-live-bar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(56, 189, 248, 0.48) 50%, transparent 100%);
  pointer-events: none;
}
.bn-live-left, .bn-live-metrics {
  display: flex;
  align-items: center;
  gap: 16px;
  white-space: nowrap;
}
.bn-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.69rem;
  color: var(--safe);
}
.bn-live-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--safe);
  box-shadow: 0 0 0 0 rgba(14, 203, 129, 0.7);
  animation: bnPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes bnPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(14, 203, 129, 0.65); }
  60% { box-shadow: 0 0 0 7px rgba(14, 203, 129, 0); }
}
.bn-metric-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.bn-metric-item strong {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--ink);
}
.bn-metric-item strong.gold { color: var(--accent); }
.bn-metric-sep {
  width: 1px;
  height: 12px;
  background: var(--border);
}

.hidden { display: none !important; }
.small { font-size: 0.85rem; }
.ig-muted-sm { font-size: 0.88rem; color: var(--muted); margin: 0; }
.ig-muted-xs { font-size: 0.78rem; color: var(--muted); }
.text-danger { color: var(--danger); }
.text-safe { color: var(--safe); }
.text-ig { color: var(--accent); }

/* --- APP SHELL & HIGH-TECH SIDEBAR --- */
.ig-shell { min-height: 100vh; display: flex; }

.ig-sidebar {
  width: var(--sidebar-w);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  border-right: 1px solid var(--border);
  background: var(--sidebar-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  padding: 20px 12px 16px 12px;
  display: flex;
  flex-direction: column;
  z-index: 40;
  transition: background 0.22s ease, border-color 0.22s ease;
}

.ig-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--ink);
  padding: 6px 10px 22px 10px;
}

.ig-brand-mark {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: var(--accent-grad);
  color: var(--accent-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--accent-glow);
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.24s ease;
}
.ig-brand:hover .ig-brand-mark {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.48);
}

.ig-brand-text { display: flex; flex-direction: column; gap: 1px; }
.ig-wordmark {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.035em;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-decoration: none;
  line-height: 1.05;
}
.ig-brand-tag {
  font-family: var(--font-mono);
  font-size: 0.61rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.ig-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }

.ig-nav-item {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-secondary);
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 11px 13px;
  border-radius: 11px;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  position: relative;
  overflow: visible;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.ig-nav-item:hover { background: var(--hover-bg); color: var(--ink); transform: translateX(2px); }
.ig-nav-item.active {
  background: linear-gradient(90deg, rgba(14, 165, 233, 0.16) 0%, rgba(37, 99, 235, 0.04) 100%);
  border-color: var(--info-border);
  color: var(--accent);
  font-weight: 700;
}
.ig-nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  bottom: 7px;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: var(--accent-grad);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.85);
}
.ig-nav-item.active .ig-icon { stroke-width: 2.3; }

.ig-icon { width: 21px; height: 21px; flex-shrink: 0; }
.ig-nav-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
}
.ig-nav-avatar img { width: 100%; height: 100%; object-fit: cover; }

.ig-ico-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ig-dot-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 800;
  line-height: 13px;
  color: #fff;
  background: var(--danger-solid);
  border: 2px solid var(--sidebar-bg);
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(246, 70, 93, 0.48);
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.ig-dot-badge.show { display: inline-flex; }

/* --- HIỆU ỨNG NỔI BẬT CHO MÁY BAY GIẤY GIAO DỊCH P2P --- */
.ig-nav-p2p .ig-nav-label {
  color: var(--accent);
  font-weight: 700;
}
.p2p-plane-wrap {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: radial-gradient(circle at 65% 35%, rgba(56, 189, 248, 0.28), rgba(37, 99, 235, 0.1) 66%, transparent 100%);
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.32), 0 0 16px rgba(37, 99, 235, 0.3);
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.24s ease, background 0.24s ease;
}
[data-theme="light"] .p2p-plane-wrap {
  background: radial-gradient(circle at 65% 35%, rgba(14, 165, 233, 0.2), rgba(37, 99, 235, 0.08) 68%, transparent 100%);
  box-shadow: inset 0 0 0 1px rgba(2, 132, 199, 0.32), 0 4px 12px rgba(37, 99, 235, 0.18);
}
.p2p-plane-ring {
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  border: 1.5px solid rgba(56, 189, 248, 0.58);
  pointer-events: none;
  animation: p2pPlaneSonar 2.6s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}
.p2p-plane-trail {
  position: absolute;
  left: 4px;
  bottom: 5px;
  width: 9px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #38bdf8, #e0f2fe);
  transform: rotate(-42deg);
  pointer-events: none;
  opacity: 0.72;
  animation: p2pTrailPulse 2.6s ease-in-out infinite;
}
.p2p-plane-ico {
  width: 19px;
  height: 19px;
  color: var(--accent);
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 0 7px rgba(56, 189, 248, 0.72));
  animation: p2pPlaneFloat 2.6s ease-in-out infinite;
  transition: filter 0.22s ease, color 0.22s ease;
}
[data-theme="light"] .p2p-plane-ico {
  color: #0284c7;
  filter: drop-shadow(0 2px 6px rgba(2, 132, 199, 0.42));
}
.ig-nav-p2p:hover .p2p-plane-wrap,
.ig-nav-p2p.active .p2p-plane-wrap {
  background: var(--accent-grad);
  box-shadow: 0 0 22px rgba(56, 189, 248, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.32);
}
.ig-nav-p2p:hover .p2p-plane-ico,
.ig-nav-p2p.active .p2p-plane-ico {
  color: #ffffff;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.78));
}
.ig-nav-p2p:hover .p2p-plane-trail,
.ig-nav-p2p.active .p2p-plane-trail {
  background: linear-gradient(90deg, transparent, #bae6fd, #ffffff);
  opacity: 0.95;
}
.p2p-plane-ico.is-launching {
  animation: p2pPlaneLaunch 0.58s cubic-bezier(0.22, 1, 0.36, 1) forwards !important;
}
.p2p-plane-wrap .ig-dot-badge {
  top: -5px;
  right: -6px;
  z-index: 3;
}
.p2p-plane-wrap .ig-dot-badge.show {
  animation: p2pBadgePulse 2.2s ease-in-out infinite;
}

@keyframes p2pPlaneFloat {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(1.8px, -2.2px) rotate(-6deg); }
}
@keyframes p2pPlaneSonar {
  0% { transform: scale(0.94); opacity: 0.72; }
  70% { transform: scale(1.38); opacity: 0; }
  100% { transform: scale(1.38); opacity: 0; }
}
@keyframes p2pTrailPulse {
  0%, 100% { opacity: 0.32; transform: rotate(-42deg) scaleX(0.75); }
  50% { opacity: 0.92; transform: rotate(-42deg) scaleX(1.15); }
}
@keyframes p2pPlaneLaunch {
  0% { transform: translate(0, 0) rotate(0deg) scale(1); opacity: 1; }
  20% { transform: translate(-2px, 2px) rotate(6deg) scale(0.92); opacity: 1; }
  52% { transform: translate(12px, -12px) rotate(-14deg) scale(0.82); opacity: 0; }
  56% { transform: translate(-9px, 9px) rotate(-6deg) scale(0.8); opacity: 0; }
  100% { transform: translate(0, 0) rotate(0deg) scale(1); opacity: 1; }
}
@keyframes p2pBadgePulse {
  0%, 100% { box-shadow: 0 2px 8px rgba(246, 70, 93, 0.5), 0 0 0 0 rgba(246, 70, 93, 0.55); }
  60% { box-shadow: 0 2px 10px rgba(246, 70, 93, 0.65), 0 0 0 6px rgba(246, 70, 93, 0); }
}
@media (max-width: 767px) {
  .p2p-plane-wrap { width: 28px; height: 28px; border-radius: 9px; }
  .p2p-plane-ico { width: 17px; height: 17px; }
  .p2p-plane-wrap .ig-dot-badge { top: -5px; right: -6px; }
}
@media (prefers-reduced-motion: reduce) {
  .p2p-plane-ico, .p2p-plane-ring, .p2p-plane-trail, .p2p-plane-wrap .ig-dot-badge.show {
    animation: none !important;
  }
}

/* Theme Toggle Button */
.ig-theme-toggle {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 11px;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  margin-bottom: 12px;
  transition: all 0.16s ease;
}
.ig-theme-toggle:hover { border-color: var(--border-glow); color: var(--accent); }
.ig-theme-ico { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }

.ig-sidebar-footer {
  padding-top: 12px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.ig-sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 7px; border-radius: 11px; cursor: pointer;
  transition: background 0.14s ease;
}
.ig-sidebar-user:hover { background: var(--hover-bg); }

/* Mobile Header (iOS Notch / Dynamic Island Safe Area) */
.ig-mobile-header {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: calc(56px + env(safe-area-inset-top));
  background: var(--sidebar-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  padding: env(safe-area-inset-top) max(14px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left));
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  z-index: 45;
}
.ig-mobile-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  min-width: 0;
}
.ig-brand-mark-sm {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}
.ig-mobile-right { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.ig-mobile-auth { display: flex; gap: 6px; align-items: center; }

/* Main Canvas */
.ig-main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; min-height: 100vh; min-height: 100dvh; overflow-x: clip; display: flex; flex-direction: column; }
.ig-content-wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 28px 26px 52px 26px; flex: 1; }

.tab-panel { display: none; animation: fadeInPanel 0.18s ease; }
.tab-panel.active { display: block; }
@keyframes fadeInPanel {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.ig-section-head { margin-bottom: 20px; }
.ig-section-head h1 { margin: 0 0 5px 0; font-family: var(--font-display); font-size: 1.52rem; font-weight: 700; letter-spacing: -0.03em; color: var(--ink); }
.ig-section-head p { margin: 0; color: var(--muted); font-size: 0.91rem; letter-spacing: -0.008em; }
.ig-section-head-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }

.ig-status-tag {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.74rem; font-weight: 700;
  color: var(--accent);
  background: var(--info-bg);
  border: 1px solid var(--info-border);
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.ig-status-tag.gemini { background: var(--safe-bg); border-color: var(--safe-border); color: var(--safe); }

/* Cards & Grids */
.ig-narrow-wrap { max-width: 740px; margin: 0 auto; }
.ig-two-col { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.ig-two-col-even { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.stack-xs { display: flex; flex-direction: column; gap: 8px; }
.stack-sm { display: flex; flex-direction: column; gap: 12px; }
.stack-md { display: flex; flex-direction: column; gap: 16px; }

.ig-card {
  position: relative;
  background: var(--surface);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--card-shadow), var(--specular);
  transition: border-color 0.24s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.24s ease, transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), background 0.24s ease;
}
.ig-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, -40%), var(--spotlight), transparent 65%);
  opacity: 0;
  transition: opacity 0.32s ease;
  pointer-events: none;
}
.ig-card:hover {
  border-color: rgba(56, 189, 248, 0.34);
}
.ig-card:hover::before { opacity: 1; }
.ig-card > * { position: relative; z-index: 1; }
.ig-card-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; margin-bottom: 14px; flex-wrap: wrap;
}
.ig-card-head h2, .ig-card-head h3 { margin: 0; font-size: 1.02rem; font-weight: 700; letter-spacing: -0.015em; color: var(--ink); }

/* Inputs */
.ig-label { display: block; font-size: 0.79rem; font-weight: 600; color: var(--ink-secondary); margin-bottom: 5px; }
.ig-input {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--input-bg);
  color: var(--ink);
  font-size: 0.91rem;
  font-family: inherit;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.ig-input::placeholder { color: var(--muted); }
.ig-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--input-focus-bg);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18);
}
textarea.ig-input { resize: vertical; }
select.ig-input option { background: var(--surface-solid); color: var(--ink); }

.ig-search-row { display: grid; grid-template-columns: 160px 1fr auto; gap: 10px; align-items: center; }
.ig-search-input-wrap { position: relative; flex: 1; }
.ig-search-ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.ig-search-pill {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--pill-search-bg);
  color: var(--ink);
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.ig-search-pill::placeholder { color: var(--muted); }
.ig-search-pill:focus { outline: none; border-color: var(--accent); background: var(--input-focus-bg); box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18); }

.form-row-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Binance Institutional Metallic Gold Buttons */
.ig-btn {
  position: relative;
  overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border-radius: 10px; border: 1px solid transparent;
  font-size: 0.87rem; font-weight: 700; font-family: inherit;
  cursor: pointer; white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.ig-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.ig-btn:active:not(:disabled) { transform: scale(0.975); }
.ig-btn-lg { padding: 10px 20px; font-size: 0.92rem; }
.ig-btn-sm { padding: 6px 13px; font-size: 0.81rem; }
.ig-btn-xs { padding: 4px 10px; font-size: 0.75rem; border-radius: 7px; }
.ig-btn-full { width: 100%; }

.ig-btn-primary {
  background: var(--accent-grad);
  color: var(--accent-ink);
  box-shadow: var(--accent-glow);
}
.ig-btn-primary::after {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 65%;
  height: 100%;
  background: linear-gradient(105deg, transparent 15%, rgba(255, 255, 255, 0.48) 50%, transparent 85%);
  transition: left 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}
.ig-btn-primary:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.ig-btn-primary:hover:not(:disabled)::after { left: 145%; }

.ig-btn-secondary { background: var(--btn-sec-bg); color: var(--btn-sec-ink); border-color: var(--border); font-weight: 600; }
.ig-btn-secondary:hover:not(:disabled) { background: var(--btn-sec-hover); border-color: rgba(56, 189, 248, 0.42); color: var(--accent); }

.ig-btn-safe { background: linear-gradient(135deg, #16da8e, #0ecb81, #03a66d); color: #0b0e11; font-weight: 800; box-shadow: 0 6px 20px rgba(14, 203, 129, 0.28); }
.ig-btn-safe:hover:not(:disabled) { filter: brightness(1.07); transform: translateY(-1px); }

.ig-btn-danger { background: linear-gradient(135deg, #ff5b71, #f6465d, #cf304a); color: #fff; box-shadow: 0 6px 20px rgba(246, 70, 93, 0.28); }
.ig-btn-danger:hover:not(:disabled) { filter: brightness(1.07); transform: translateY(-1px); }

.ig-btn-amber { background: var(--accent-grad); color: var(--accent-ink); font-weight: 800; box-shadow: var(--accent-glow); }
.ig-btn-amber:hover:not(:disabled) { filter: brightness(1.06); transform: translateY(-1px); }

.ig-icon-btn {
  border: none; background: transparent; color: var(--ink);
  padding: 7px; border-radius: 10px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.ig-icon-btn:hover { background: var(--hover-bg); color: var(--accent); }

.ig-link-btn {
  border: none; background: transparent; color: var(--accent);
  font-size: 0.84rem; font-weight: 600; cursor: pointer; padding: 4px; font-family: inherit;
}
.ig-link-btn:hover { text-decoration: underline; }

/* Prism Avatar Rings */
.ig-ring {
  padding: 2.5px; border-radius: 50%;
  background: var(--prism-grad);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ig-ring-sm { padding: 2px; }
.ig-ring-lg { padding: 3.5px; box-shadow: 0 0 32px rgba(56, 189, 248, 0.32); }

.avatar-xs, .avatar-sm, .avatar-md, .ig-avatar-xl {
  border-radius: 50%;
  background: linear-gradient(135deg, #1b2434, #0c1018);
  color: #7dd3fc; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
}
.avatar-xs { width: 28px; height: 28px; font-size: 0.7rem; }
.avatar-sm { width: 36px; height: 36px; font-size: 0.84rem; border: 2px solid var(--avatar-ring-gap); }
.avatar-md { width: 54px; height: 54px; font-size: 1.05rem; border: 2.5px solid var(--avatar-ring-gap); }
.ig-avatar-xl { width: 140px; height: 140px; font-size: 2.5rem; border: 4px solid var(--avatar-ring-gap); }
.avatar-xs img, .avatar-sm img, .avatar-md img, .ig-avatar-xl img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Cyber Dropzone */
.ig-dropzone {
  border: 1.5px dashed var(--border);
  border-radius: 14px;
  padding: 26px 16px;
  text-align: center;
  background: var(--input-bg);
  cursor: pointer;
  color: var(--muted);
  transition: all 0.18s ease;
}
.ig-dropzone:hover, .ig-dropzone.dragover {
  border-color: var(--accent);
  background: var(--info-bg);
  color: var(--ink);
}
.ig-dropzone-inner { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.ig-dropzone-title { font-weight: 600; font-size: 0.92rem; color: var(--ink); }
.ig-upload-preview { display: flex; align-items: center; gap: 14px; text-align: left; }
.ig-upload-preview img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }

/* Empty States */
.ig-empty { text-align: center; padding: 38px 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ig-empty h3 { margin: 4px 0 0 0; font-size: 1.04rem; color: var(--ink); }
.ig-empty-circle {
  width: 62px; height: 62px; border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 4px;
}

/* Badges & Alerts */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 0.74rem; font-weight: 700; white-space: nowrap; }
.badge-high { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); }
.badge-medium { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-border); }
.badge-safe { background: var(--safe-bg); color: var(--safe); border: 1px solid var(--safe-border); }
.badge-purple { background: var(--purple-bg); color: var(--purple); border: 1px solid var(--purple-border); }
.badge-ig { background: var(--info-bg); color: var(--accent); border: 1px solid var(--info-border); }
.badge-neutral { background: var(--surface-soft); color: var(--ink-secondary); border: 1px solid var(--border-soft); }

.alert-box { padding: 12px 14px; border-radius: 12px; font-size: 0.88rem; border: 1px solid; }
.alert-danger { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger); }
.alert-warn { background: var(--warn-bg); border-color: var(--warn-border); color: var(--warn); }
.alert-safe { background: var(--safe-bg); border-color: var(--safe-border); color: var(--safe); }
.alert-info { background: var(--info-bg); border-color: var(--info-border); color: var(--info-ink); }
.notice-soft { background: var(--surface-soft); border: 1px solid var(--border-soft); border-radius: 12px; padding: 11px 13px; font-size: 0.85rem; color: var(--ink-secondary); }

.ig-sandbox-note {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--warn);
  border-radius: 12px;
  padding: 11px 15px;
  font-size: 0.83rem;
  color: var(--ink-secondary);
  margin-bottom: 12px;
}

.ig-fee-schedule-bar {
  padding: 13px 16px;
  margin-bottom: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.ig-fee-schedule-info { display: flex; flex-direction: column; gap: 6px; }
.ig-fee-tiers { display: flex; gap: 8px; flex-wrap: wrap; font-size: 0.82rem; }
.ig-fee-tier-chip {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  padding: 4px 11px;
  border-radius: 999px;
  color: var(--ink-secondary);
}
.ig-fee-tier-chip strong { color: var(--accent); font-family: var(--font-sans); font-variant-numeric: tabular-nums; font-weight: 700; }

/* Chips */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: var(--btn-sec-bg); border: 1px solid var(--border-soft); color: var(--ink); padding: 6px 12px; border-radius: 999px; font-size: 0.8rem; font-weight: 500; cursor: pointer; }
.chip:hover { border-color: var(--accent); color: var(--accent); }

/* Analyzer Result */
.risk-meter-card { border-radius: 14px; padding: 16px; border: 1px solid; }
.risk-meter-card.high { background: var(--danger-bg); border-color: var(--danger-border); }
.risk-meter-card.medium { background: var(--warn-bg); border-color: var(--warn-border); }
.risk-meter-card.low { background: var(--safe-bg); border-color: var(--safe-border); }
.risk-meter-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.risk-score-num { font-family: var(--font-display); font-variant-numeric: tabular-nums; font-size: 1.78rem; font-weight: 700; letter-spacing: -0.03em; }
.progress-track { width: 100%; height: 7px; border-radius: 999px; background: var(--surface-soft); overflow: hidden; margin-bottom: 10px; }
.progress-fill { height: 100%; border-radius: 999px; }
.progress-fill.high { background: var(--danger-solid); }
.progress-fill.medium { background: var(--warn); }
.progress-fill.low { background: var(--safe); }
.bullet-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; font-size: 0.89rem; color: var(--ink-secondary); }

/* Reports & Lookup */
.report-item { border: 1px solid var(--border-soft); border-radius: 12px; padding: 13px; background: var(--surface-soft); }
.report-item-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 5px; }
.report-identifier { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-weight: 700; font-size: 0.92rem; color: var(--ink); }
.rep-step-box {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px 14px;
  transition: border-color 0.18s ease;
}
.rep-step-box:focus-within {
  border-color: rgba(56, 189, 248, 0.55);
}
.rep-step-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.rep-step-head strong {
  display: block;
  font-size: 0.9rem;
  color: var(--ink);
  line-height: 1.25;
}
.rep-step-sub {
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: 2px;
}
.rep-step-num {
  width: 26px;
  height: 26px;
  border-radius: 9px;
  background: var(--accent-grad);
  color: #ffffff;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}
.rep-dual-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
  margin: 6px 0 8px 0;
}
.rep-dual-card {
  background: var(--input-bg);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.82rem;
}
.rep-dual-label {
  font-size: 0.69rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 3px;
}
.rep-dual-val {
  color: var(--ink);
  font-weight: 600;
  word-break: break-word;
}
.trend-row { display: grid; grid-template-columns: 1fr 110px 30px; align-items: center; gap: 10px; font-size: 0.84rem; }
.trend-bar-bg { height: 6px; background: var(--surface-soft); border-radius: 999px; overflow: hidden; }
.trend-bar-fg { height: 100%; background: var(--accent-grad); border-radius: 999px; }
.filter-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.lookup-stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.lookup-stat { border: 1px solid var(--border-soft); border-radius: 12px; padding: 11px; background: var(--surface-soft); }
.lookup-stat span { display: block; font-size: 0.74rem; color: var(--muted); }
.lookup-stat strong { display: block; font-size: 1.08rem; margin-top: 2px; font-family: var(--font-display); font-variant-numeric: tabular-nums; font-weight: 700; letter-spacing: -0.02em; }

/* Evidence Photo Upload & Gallery */
.evidence-upload-zone {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1.5px dashed var(--border);
  border-radius: 12px;
  background: var(--input-bg);
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}
.evidence-upload-zone:hover,
.evidence-upload-zone.dragover {
  border-color: var(--accent);
  background: var(--info-bg);
}
.evidence-upload-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.evidence-thumb-item {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-soft);
}
.evidence-thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.evidence-thumb-rm {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: rgba(15, 23, 42, 0.82);
  color: #fff;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.evidence-thumb-rm:hover { background: var(--danger-solid); }
.evidence-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0 10px 0;
}
.evidence-gallery-img {
  width: 78px;
  height: 78px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  cursor: zoom-in;
  display: block;
  transition: transform 0.14s ease, border-color 0.14s ease;
}
.evidence-gallery-img:hover {
  transform: scale(1.05);
  border-color: var(--accent);
}

/* --- P2P EXPLAINER VIDEO CARD --- */
.p2p-video-card {
  border-color: var(--info-border);
}
.p2p-video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #050814;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.34);
}
.p2p-guide-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: #050814;
}
.p2p-video-chapters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.p2p-chap-btn {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.76rem;
}

/* Private P2P Guest Gate, Join-by-Code & Invite Lock */
.p2p-guest-gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 34px 24px;
  border-color: var(--info-border);
}
.p2p-guest-icon {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: var(--info-bg);
  border: 1px solid var(--info-border);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.p2p-join-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  border-color: var(--info-border);
}
.p2p-quick-hub {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  border-color: var(--info-border);
}
.p2p-hub-create {
  display: flex;
  align-items: center;
}
.p2p-join-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 1;
  min-width: 240px;
  max-width: 340px;
}
.p2p-code-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.p2p-code-6 {
  text-align: center;
  font-size: 1.05rem;
  letter-spacing: 0.24em;
}
.p2p-invite-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 13px 16px;
  border-radius: 14px;
  border: 1px solid var(--info-border);
  background: var(--info-bg);
}
.p2p-invite-strip.locked {
  border-color: var(--safe-border);
  background: var(--safe-bg);
  color: var(--safe);
}
.p2p-invite-code-big {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.32rem;
  font-weight: 900;
  letter-spacing: 0.24em;
  color: var(--accent);
  background: var(--input-bg);
  border: 1px solid var(--info-border);
  padding: 5px 14px 5px 18px;
  border-radius: 10px;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.18);
}

/* --- P2P ESCROW + DM CHAT --- */
.ig-subbox { background: var(--surface-soft); border: 1px solid var(--border-soft); border-radius: 12px; padding: 12px; }
.ig-subbox-k { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 0.71rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 8px; }

.ig-fee-box {
  background: var(--banner-bg); color: var(--banner-ink);
  border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 6px; font-size: 0.88rem;
}
.fee-row { display: flex; justify-content: space-between; gap: 12px; }
.fee-row strong { font-family: var(--font-sans); font-variant-numeric: tabular-nums; font-weight: 700; letter-spacing: -0.015em; }
.fee-row-em { padding-top: 7px; border-top: 1px solid rgba(56, 189, 248, 0.24); color: #38bdf8; font-size: 0.95rem; }

.p2p-list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 4px;
}
.p2p-list-filter .ig-seg-btn {
  padding: 5px 11px;
  font-size: 0.78rem;
}
.p2p-rooms-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.p2p-order-card {
  position: relative;
  border: 1px solid var(--border);
  border-left: 4px solid var(--border-glow);
  border-radius: 15px;
  padding: 15px 18px;
  background: var(--surface-soft);
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(130px, 0.95fr) auto;
  gap: 16px;
  align-items: center;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s ease;
}
.p2p-order-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.24);
}
.p2p-order-card.is-clickable { cursor: pointer; }

/* Phòng đã hoàn tất -> Tô nền xanh lá nhạt dịu mắt, dễ nhận biết ngay */
.p2p-order-card.is-completed {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.16) 0%, rgba(52, 211, 153, 0.07) 100%);
  border-color: rgba(52, 211, 153, 0.42);
  border-left-color: #10b981;
}
.p2p-order-card.is-completed:hover {
  border-color: rgba(52, 211, 153, 0.68);
  box-shadow: 0 10px 26px rgba(16, 185, 129, 0.16);
}
[data-theme="light"] .p2p-order-card.is-completed {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border-color: #6ee7b7;
  border-left-color: #059669;
}
[data-theme="light"] .p2p-order-card.is-completed:hover {
  border-color: #34d399;
  box-shadow: 0 10px 24px rgba(5, 150, 105, 0.12);
}

/* Phòng đang khóa quỹ / giao hàng -> Điểm nhấn xanh sapphire */
.p2p-order-card.is-active-deal {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.11) 0%, rgba(37, 99, 235, 0.04) 100%);
  border-color: rgba(56, 189, 248, 0.34);
  border-left-color: #38bdf8;
}
/* Phòng đang tranh chấp */
.p2p-order-card.is-disputed {
  background: linear-gradient(135deg, rgba(246, 70, 93, 0.12) 0%, rgba(246, 70, 93, 0.04) 100%);
  border-color: rgba(246, 70, 93, 0.36);
  border-left-color: #f6465d;
}
/* Phòng đã hủy / hoàn tiền -> Giảm nổi bật để không rối mắt */
.p2p-order-card.is-muted-deal {
  opacity: 0.74;
  border-left-color: var(--muted);
}
.p2p-order-card.is-muted-deal:hover { opacity: 0.96; }

.p2p-card-main {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}
.p2p-card-top {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.p2p-card-peer {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.84rem;
  color: var(--ink);
}
.p2p-peer-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--btn-sec-bg);
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.p2p-order-card.is-completed .p2p-peer-dot {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(52, 211, 153, 0.45);
  color: var(--safe);
}
.p2p-card-amount {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  text-align: right;
}
.p2p-amount-big {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.06rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.2;
}
.p2p-order-card.is-completed .p2p-amount-big {
  color: var(--safe);
}
.p2p-card-action {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.p2p-btn-done-view {
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(52, 211, 153, 0.45);
  color: var(--safe);
}
.p2p-btn-done-view:hover {
  background: rgba(16, 185, 129, 0.26);
  border-color: var(--safe);
}
[data-theme="light"] .p2p-btn-done-view {
  background: #ffffff;
  border-color: #34d399;
  color: #047857;
}
[data-theme="light"] .p2p-btn-done-view:hover {
  background: #ecfdf5;
}

@media (max-width: 780px) {
  .p2p-card-amount {
    align-items: flex-start;
    text-align: left;
  }
}
.deal-code { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 600; font-size: 0.84rem; color: var(--accent); letter-spacing: -0.01em; }

.p2p-room-topbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.ig-segment { display: inline-flex; gap: 3px; background: var(--input-bg); border: 1px solid var(--border); padding: 3px; border-radius: 11px; }
.ig-seg-btn { border: none; background: transparent; padding: 7px 14px; border-radius: 8px; font-size: 0.83rem; font-weight: 600; color: var(--muted); cursor: pointer; font-family: inherit; transition: all 0.18s ease; }
.ig-seg-btn:hover:not(.active) { color: var(--ink); }
.ig-seg-btn.active { background: var(--accent-grad); color: var(--accent-ink); font-weight: 800; box-shadow: 0 4px 14px rgba(37, 99, 235, 0.34); }

.p2p-order-banner {
  background: var(--banner-bg);
  border: 1px solid var(--border);
  color: var(--banner-ink);
  border-radius: 16px;
  padding: 18px 22px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
}
.p2p-banner-title { font-size: 1.15rem; font-weight: 700; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.p2p-countdown {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(14, 165, 233, 0.16); border: 1px solid rgba(56, 189, 248, 0.42);
  color: #7dd3fc; padding: 3px 10px; border-radius: 999px;
  font-family: var(--font-mono); font-size: 0.84rem; font-weight: 800;
}
.p2p-banner-meta { text-align: right; font-size: 0.82rem; color: var(--banner-sub); }
.p2p-banner-meta strong { color: #fff; }

.p2p-room-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.98fr); gap: 18px; align-items: start; }

.p2p-stepper { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.p2p-step { background: var(--surface-soft); border: 1px solid var(--border-soft); border-radius: 10px; padding: 8px 9px; display: flex; align-items: center; gap: 7px; font-size: 0.78rem; font-weight: 600; color: var(--muted); }
.p2p-step-num { width: 20px; height: 20px; border-radius: 50%; background: var(--btn-sec-bg); color: var(--muted); display: inline-flex; align-items: center; justify-content: center; font-size: 0.72rem; font-weight: 800; flex-shrink: 0; }
.p2p-step.done { background: var(--safe-bg); border-color: var(--safe-border); color: var(--safe); }
.p2p-step.done .p2p-step-num { background: var(--safe); color: #fff; }
.p2p-step.current { background: var(--info-bg); border-color: var(--info-border); color: var(--accent); }
.p2p-step.current .p2p-step-num { background: var(--accent-strong); color: #fff; }
.p2p-step.disputed { background: var(--purple-bg); border-color: var(--purple-border); color: var(--purple); }
.p2p-step.disputed .p2p-step-num { background: var(--purple); color: #fff; }
.p2p-step-lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.p2p-step-card { display: flex; flex-direction: column; gap: 14px; }
.p2p-step-card-safe { border-color: var(--safe-border); }
.p2p-step-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }

.p2p-compact-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.p2p-compact-item {
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  border-radius: 11px;
  padding: 9px 11px;
}
.p2p-compact-item span { display: block; font-size: 0.72rem; color: var(--muted); }
.p2p-compact-item strong { display: block; font-size: 0.96rem; margin-top: 2px; font-family: var(--font-display); font-variant-numeric: tabular-nums; font-weight: 700; letter-spacing: -0.02em; }

.p2p-paid-receipt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--safe-bg);
  border: 1px solid var(--safe-border);
}
.p2p-paid-ico {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--safe);
  color: #080a0e;
  font-weight: 900;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.p2p-details-fold {
  border-top: 1px solid var(--border-soft);
  padding-top: 10px;
}
.p2p-details-fold summary {
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}
.p2p-details-fold summary::-webkit-details-marker { display: none; }
.p2p-details-fold summary::after { content: "▾"; font-size: 0.9rem; transition: transform 0.16s ease; }
.p2p-details-fold[open] summary::after { transform: rotate(180deg); }
.p2p-details-fold summary:hover { color: var(--ink); }
.p2p-details-body { margin-top: 10px; }

@media (max-width: 560px) {
  .p2p-compact-summary { grid-template-columns: 1fr; }
}

/* Official Copyright & Authenticity Footer — Minimal Institutional (Apple / Stripe / Linear) */
.antam-legal-footer {
  position: relative;
  width: 100%;
  max-width: 1040px;
  margin: auto auto 4px auto;
  padding: 22px 26px 26px 26px;
  background: transparent;
  border: none;
}
.antam-legal-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 26px;
  right: 26px;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--border) 12%, var(--border) 88%, transparent 100%);
  opacity: 0.85;
}
.antam-footer-primary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px 20px;
  flex-wrap: wrap;
}
.antam-footer-identity {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-wrap: wrap;
}
.antam-footer-mark {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.24);
  color: var(--accent-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
[data-theme="light"] .antam-footer-mark {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.22);
  color: var(--accent);
}
.antam-footer-name {
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.antam-footer-divider {
  width: 1px;
  height: 13px;
  background: var(--border);
  opacity: 0.8;
}
.antam-footer-tagline {
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: -0.005em;
}
.antam-footer-links {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.antam-footer-link {
  appearance: none;
  background: none;
  border: none;
  padding: 2px 0;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.16s ease;
}
.antam-footer-link:hover {
  color: var(--ink);
}
.antam-footer-dot {
  color: var(--border);
  font-size: 0.75rem;
  user-select: none;
}
.antam-origin-pill {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.71rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease, background-color 0.18s ease;
}
[data-theme="light"] .antam-origin-pill {
  background: rgba(15, 23, 42, 0.025);
}
.antam-origin-pill:hover {
  border-color: rgba(16, 185, 129, 0.36);
  color: var(--ink);
  background: rgba(16, 185, 129, 0.06);
}
.antam-origin-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.16);
  flex-shrink: 0;
}
.antam-footer-colophon {
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 18px;
  flex-wrap: wrap;
  font-size: 0.73rem;
  color: var(--muted);
  opacity: 0.78;
}
.antam-colophon-copy {
  font-weight: 500;
  letter-spacing: 0.005em;
}
.antam-colophon-legal {
  letter-spacing: 0.005em;
}

/* Luxury Copyright & Authenticity Modal */
.antam-cr-modal {
  max-width: 580px;
  padding: 24px 26px 20px 26px;
  border-radius: 20px;
}
.antam-cr-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}
.antam-cr-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.antam-cr-emblem {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(56, 189, 248, 0.14), rgba(37, 99, 235, 0.06));
  border: 1px solid rgba(56, 189, 248, 0.28);
  color: var(--accent-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
[data-theme="light"] .antam-cr-emblem {
  color: var(--accent);
}
.antam-cr-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.antam-cr-sub {
  margin-top: 2px;
  font-size: 0.75rem;
  color: var(--muted);
}
.antam-cr-close {
  appearance: none;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.antam-cr-close:hover {
  background: var(--surface-soft);
  color: var(--ink);
  border-color: var(--border);
}
.antam-cr-origin-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 13px;
  border-radius: 12px;
  border: 1px solid rgba(16, 185, 129, 0.24);
  background: rgba(16, 185, 129, 0.055);
  margin-bottom: 16px;
}
.antam-cr-origin-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.78rem;
}
.antam-cr-origin-lbl {
  font-weight: 600;
  color: var(--safe);
}
.antam-cr-origin-url {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--ink);
  font-weight: 600;
}
.antam-cr-sec-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: var(--surface);
}
.antam-cr-body {
  max-height: min(52vh, 410px);
  overflow-y: auto;
  padding-right: 4px;
}
.antam-cr-section {
  padding: 14px 0;
  border-top: 1px solid var(--border-soft);
}
.antam-cr-section:first-child {
  padding-top: 2px;
  border-top: none;
}
.antam-cr-sec-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
}
.antam-cr-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-soft);
  letter-spacing: 0.04em;
}
[data-theme="light"] .antam-cr-num {
  color: var(--accent);
}
.antam-cr-sec-head h3 {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.antam-cr-list {
  margin: 0;
  padding-left: 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.81rem;
  line-height: 1.58;
  color: var(--muted);
}
.antam-cr-list strong {
  color: var(--ink);
  font-weight: 600;
}
.antam-cr-footer {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.antam-cr-json-link {
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}
.antam-cr-json-link:hover {
  color: var(--accent-soft);
}

.antam-offline-banner {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(17, 20, 27, 0.94);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fde68a;
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
}
.antam-offline-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.22);
}
.ig-auth-link-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.antam-frame-warning {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(8, 10, 14, 0.96);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  gap: 14px;
}
@media (max-width: 780px) {
  .antam-legal-footer {
    margin: 24px 0 calc(20px + env(safe-area-inset-bottom)) 0;
    padding: 20px 14px 16px 14px;
  }
  .antam-legal-footer::before {
    left: 14px;
    right: 14px;
  }
  .antam-footer-primary,
  .antam-footer-colophon {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .antam-footer-divider {
    display: none;
  }
  .antam-cr-modal {
    padding: 18px 18px 16px 18px;
  }
}

.p2p-shield-strip {
  border: 1px solid var(--border-soft);
  background: rgba(56, 189, 248, 0.045);
  border-radius: 12px;
  padding: 9px 14px;
  font-size: 0.79rem;
  color: var(--ink-secondary);
}
[data-theme="light"] .p2p-shield-strip {
  background: rgba(37, 99, 235, 0.04);
}
.p2p-shield-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  line-height: 1.4;
}
.p2p-shield-summary::-webkit-details-marker { display: none; }
.p2p-shield-summary strong { color: var(--ink); font-weight: 600; }
.p2p-shield-more {
  flex-shrink: 0;
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--accent-soft);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
}
[data-theme="light"] .p2p-shield-more { color: var(--accent); }
.p2p-shield-detail {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-soft);
  font-size: 0.77rem;
  line-height: 1.5;
  color: var(--muted);
}
.p2p-key-note {
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--ink-secondary);
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
}
.p2p-key-note strong { color: var(--ink); }
.p2p-key-note.is-danger {
  border-color: var(--danger-border);
  background: var(--danger-bg);
  color: var(--danger);
}
.p2p-key-note.is-danger strong { color: var(--danger); }
.p2p-key-note.is-safe {
  border-color: var(--safe-border);
  background: var(--safe-bg);
  color: var(--safe);
}
.p2p-key-note.is-safe strong { color: var(--safe); }
.chat-msg-system.is-critical {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger);
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 11px;
  max-width: 92%;
}

.p2p-metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.p2p-metric { background: var(--surface-soft); border: 1px solid var(--border-soft); border-radius: 10px; padding: 10px 11px; }
.p2p-metric span { display: block; font-size: 0.72rem; color: var(--muted); }
.p2p-metric strong { display: block; font-size: 0.98rem; margin-top: 2px; font-family: var(--font-display); font-variant-numeric: tabular-nums; font-weight: 700; letter-spacing: -0.02em; }

.payment-box { border: 1px solid var(--info-border); background: var(--surface-soft); border-radius: 14px; padding: 16px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.payment-kv-list { flex: 1; min-width: 210px; display: flex; flex-direction: column; gap: 8px; }
.payment-kv { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 0.88rem; padding-bottom: 7px; border-bottom: 1px solid var(--border-soft); }
.payment-kv:last-child { border-bottom: none; padding-bottom: 0; }
.qr-svg-wrap {
  width: 152px; min-height: 152px; background: #ffffff; padding: 8px;
  border-radius: 14px; border: 1px solid var(--border); flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
.vietqr-img {
  width: 136px;
  height: auto;
  max-height: 170px;
  object-fit: contain;
  border-radius: 8px;
  display: block;
}
.qr-caption { font-size: 0.65rem; font-weight: 800; letter-spacing: 0.08em; color: #1d4ed8; margin-top: 4px; text-transform: uppercase; }
.p2p-seller-card { border: 1px solid var(--safe-border); background: var(--surface); }
.p2p-seller-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.p2p-seller-head h3 { margin: 0; font-size: 0.96rem; }

/* Tech DM Chat Panel */
.ig-dm-panel {
  background: var(--surface);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  height: 660px;
  position: sticky;
  top: 20px;
  overflow: hidden;
  box-shadow: var(--card-shadow), var(--specular);
  transition: background 0.55s ease, border-color 0.55s ease, box-shadow 0.55s ease;
}

/* Chế độ Xanh Ngọc (Jade-Emerald) ấn tượng & tinh tế sau khi Admin xác nhận đã nhận tiền */
.ig-dm-panel.is-admin-funded {
  background:
    radial-gradient(520px 260px at 50% -10%, rgba(45, 212, 191, 0.34), transparent 68%),
    radial-gradient(400px 280px at 100% 100%, rgba(16, 185, 129, 0.24), transparent 72%),
    linear-gradient(165deg, #052c27 0%, #083d36 48%, #042220 100%);
  border: 1.5px solid rgba(45, 212, 191, 0.58);
  box-shadow:
    0 0 0 1px rgba(45, 212, 191, 0.22),
    0 22px 58px rgba(13, 148, 136, 0.32),
    inset 0 1px 0 rgba(153, 246, 228, 0.28);
}
.ig-dm-panel.is-admin-funded .ig-dm-header {
  background: rgba(4, 47, 46, 0.52);
  border-bottom-color: rgba(45, 212, 191, 0.24);
}
.ig-dm-panel.is-admin-funded .ig-live-dot {
  color: #5eead4;
  background: rgba(20, 184, 166, 0.18);
  border: 1px solid rgba(94, 234, 212, 0.42);
  padding: 4px 10px;
  border-radius: 999px;
}
.ig-dm-panel.is-admin-funded .ig-live-dot::before {
  background: #2dd4bf;
  box-shadow: 0 0 10px #2dd4bf;
}
.ig-dm-panel.is-admin-funded .ig-dm-safety {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.22), rgba(20, 184, 166, 0.22));
  border-bottom-color: rgba(45, 212, 191, 0.28);
  color: #99f6e4;
  font-weight: 700;
}
.ig-dm-panel.is-admin-funded .ig-dm-messages {
  background-image: radial-gradient(rgba(94, 234, 212, 0.1) 1px, transparent 1px);
  background-size: 20px 20px;
}
.ig-dm-panel.is-admin-funded .chat-msg-system {
  background: rgba(4, 47, 46, 0.65);
  border-color: rgba(45, 212, 191, 0.28);
  color: #ccfbf1;
}
.ig-dm-panel.is-admin-funded .chat-bubble {
  background: rgba(6, 78, 59, 0.52);
  border: 1px solid rgba(94, 234, 212, 0.2);
  color: #f0fdfa;
}
.ig-dm-panel.is-admin-funded .chat-msg-row.mine .chat-bubble {
  background: linear-gradient(135deg, #14b8a6 0%, #059669 100%);
  border-color: rgba(153, 246, 228, 0.35);
  color: #ffffff;
}
.ig-dm-panel.is-admin-funded .ig-dm-quick {
  border-top-color: rgba(45, 212, 191, 0.2);
  background: rgba(4, 47, 46, 0.35);
}
.ig-dm-panel.is-admin-funded .quick-reply-btn {
  background: rgba(6, 78, 59, 0.45);
  border-color: rgba(45, 212, 191, 0.3);
  color: #ccfbf1;
}
.ig-dm-panel.is-admin-funded .quick-reply-btn:hover {
  border-color: #5eead4;
  color: #ffffff;
}
.ig-dm-panel.is-admin-funded .ig-dm-composer-wrap {
  background: rgba(4, 47, 46, 0.45);
}
.ig-dm-panel.is-admin-funded .ig-dm-pill {
  background: rgba(3, 34, 32, 0.78);
  border-color: rgba(45, 212, 191, 0.35);
}
.ig-dm-panel.is-admin-funded .ig-dm-send {
  color: #5eead4;
}

/* Chế độ Xanh Ngọc (Jade-Emerald) tinh tế cho Light Mode */
[data-theme="light"] .ig-dm-panel.is-admin-funded {
  background:
    radial-gradient(500px 240px at 50% -10%, rgba(45, 212, 191, 0.28), transparent 68%),
    radial-gradient(380px 260px at 100% 100%, rgba(16, 185, 129, 0.18), transparent 70%),
    linear-gradient(165deg, #ecfdf5 0%, #d4faee 52%, #e6fffa 100%);
  border: 1.5px solid #14b8a6;
  box-shadow:
    0 0 0 1px rgba(20, 184, 166, 0.18),
    0 18px 46px rgba(13, 148, 136, 0.2);
}
[data-theme="light"] .ig-dm-panel.is-admin-funded .ig-dm-header {
  background: rgba(255, 255, 255, 0.72);
  border-bottom-color: rgba(20, 184, 166, 0.24);
}
[data-theme="light"] .ig-dm-panel.is-admin-funded .ig-live-dot {
  color: #0f766e;
  background: rgba(20, 184, 166, 0.14);
  border-color: rgba(20, 184, 166, 0.38);
}
[data-theme="light"] .ig-dm-panel.is-admin-funded .ig-dm-safety {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.16), rgba(20, 184, 166, 0.18));
  border-bottom-color: rgba(20, 184, 166, 0.25);
  color: #0f766e;
}
[data-theme="light"] .ig-dm-panel.is-admin-funded .ig-dm-messages {
  background-image: radial-gradient(rgba(13, 148, 136, 0.12) 1px, transparent 1px);
  background-size: 20px 20px;
}
[data-theme="light"] .ig-dm-panel.is-admin-funded .chat-msg-system {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(20, 184, 166, 0.28);
  color: #115e59;
}
[data-theme="light"] .ig-dm-panel.is-admin-funded .chat-bubble {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(20, 184, 166, 0.24);
  color: #0f172a;
}
[data-theme="light"] .ig-dm-panel.is-admin-funded .chat-msg-row.mine .chat-bubble {
  background: linear-gradient(135deg, #0d9488 0%, #059669 100%);
  border-color: transparent;
  color: #ffffff;
}
[data-theme="light"] .ig-dm-panel.is-admin-funded .ig-dm-quick {
  background: rgba(255, 255, 255, 0.55);
  border-top-color: rgba(20, 184, 166, 0.2);
}
[data-theme="light"] .ig-dm-panel.is-admin-funded .quick-reply-btn {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(20, 184, 166, 0.3);
  color: #0f766e;
}
[data-theme="light"] .ig-dm-panel.is-admin-funded .ig-dm-composer-wrap {
  background: rgba(255, 255, 255, 0.6);
}
[data-theme="light"] .ig-dm-panel.is-admin-funded .ig-dm-pill {
  background: #ffffff;
  border-color: rgba(20, 184, 166, 0.42);
}
[data-theme="light"] .ig-dm-panel.is-admin-funded .ig-dm-send {
  color: #0d9488;
}
.ig-dm-header { padding: 12px 16px; border-bottom: 1px solid var(--border-soft); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ig-dm-peer { display: flex; align-items: center; gap: 10px; }
.ig-live-dot { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 0.72rem; font-weight: 700; color: var(--safe); display: inline-flex; align-items: center; gap: 6px; }
.ig-live-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--safe); box-shadow: 0 0 8px var(--safe); }
.ig-dm-safety { background: var(--surface-soft); border-bottom: 1px solid var(--border-soft); color: var(--muted); font-size: 0.75rem; padding: 8px 14px; text-align: center; }
.ig-dm-messages { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.chat-msg-system { flex-shrink: 0; align-self: center; max-width: 88%; text-align: center; font-size: 0.75rem; color: var(--muted); background: var(--surface-soft); border: 1px solid var(--border-soft); padding: 6px 12px; border-radius: 999px; }

/* Thẻ thông báo Xác nhận đã nhận tiền chính thức từ Admin (không thể giả mạo bằng chat thường) */
.chat-verified-fund-card {
  flex-shrink: 0;
  align-self: stretch;
  margin: 6px 0;
  border-radius: 16px;
  padding: 15px 16px;
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.24) 0%, rgba(16, 185, 129, 0.18) 100%);
  backdrop-filter: blur(12px);
  border: 1.5px solid rgba(94, 234, 212, 0.62);
  box-shadow: 0 12px 32px rgba(13, 148, 136, 0.28), inset 0 1px 0 rgba(204, 251, 241, 0.3);
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  animation: cvfEnter 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes cvfEnter {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
[data-theme="light"] .chat-verified-fund-card {
  background: rgba(255, 255, 255, 0.92);
  border-color: #14b8a6;
  box-shadow: 0 10px 28px rgba(13, 148, 136, 0.16);
}
.cvf-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cvf-shield {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, #10b981, #06b6d4);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.55);
  animation: cvfPulse 2.2s ease-in-out infinite;
}
@keyframes cvfPulse {
  0%, 100% { box-shadow: 0 0 14px rgba(16, 185, 129, 0.45); }
  50% { box-shadow: 0 0 26px rgba(16, 185, 129, 0.85); }
}
.cvf-kicker {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--safe);
}
.cvf-title {
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.25;
}
.cvf-amounts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.cvf-stat {
  background: var(--surface);
  border: 1px solid var(--safe-border);
  border-radius: 10px;
  padding: 8px 10px;
}
.cvf-stat span {
  display: block;
  font-size: 0.7rem;
  color: var(--muted);
}
.cvf-stat strong {
  display: block;
  margin-top: 2px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1rem;
  font-weight: 800;
  color: var(--safe);
}
.cvf-note {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-secondary);
  line-height: 1.4;
}
.cvf-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  color: var(--muted);
  border-top: 1px solid var(--safe-border);
  padding-top: 7px;
}
.chat-msg-row { flex-shrink: 0; display: flex; flex-direction: column; max-width: 78%; }
.chat-msg-row.mine { align-self: flex-end; align-items: flex-end; }
.chat-msg-row.other { align-self: flex-start; align-items: flex-start; }
.chat-msg-meta { font-size: 0.7rem; color: var(--muted); margin-bottom: 3px; padding: 0 6px; }

.chat-bubble {
  padding: 9px 14px; border-radius: 20px; font-size: 0.9rem; line-height: 1.42; word-break: break-word;
  background: var(--btn-sec-bg); color: var(--ink);
}
.chat-msg-row.mine .chat-bubble { background: var(--accent-grad); color: var(--accent-ink); font-weight: 500; box-shadow: 0 4px 16px rgba(37, 99, 235, 0.28); }
.chat-msg-row.role-admin .chat-bubble { background: var(--purple-bg); border: 1px solid var(--purple-border); color: var(--purple); }
.chat-img-thumb { display: block; max-width: 210px; max-height: 210px; border-radius: 14px; margin-top: 6px; cursor: zoom-in; }
.chat-warning-note { margin-top: 4px; font-size: 0.74rem; font-weight: 600; color: var(--danger); background: var(--danger-bg); padding: 4px 10px; border-radius: 10px; }

.ig-dm-quick { padding: 7px 12px; border-top: 1px solid var(--border-soft); display: flex; gap: 6px; overflow-x: auto; }
.quick-reply-btn { white-space: nowrap; font-size: 0.75rem; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-soft); color: var(--ink-secondary); cursor: pointer; font-family: inherit; }
.quick-reply-btn:hover { border-color: var(--accent); color: var(--accent); }

.chat-image-preview { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--surface-soft); border-top: 1px solid var(--border-soft); }
.chat-image-preview img { width: 40px; height: 40px; object-fit: cover; border-radius: 8px; }

.ig-dm-composer-wrap { padding: 10px 12px 12px 12px; }
.ig-dm-pill { display: flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px 4px 8px; background: var(--input-bg); }
.ig-dm-pill:focus-within { border-color: var(--accent); }
.ig-dm-input { border: none; flex: 1; font-size: 0.9rem; font-family: inherit; background: transparent; padding: 6px 4px; color: var(--ink); }
.ig-dm-input:focus { outline: none; }
.ig-dm-send { border: none; background: transparent; color: var(--accent); font-weight: 700; font-size: 0.88rem; cursor: pointer; padding: 4px 6px; font-family: inherit; }

/* --- PROFILE & FRIEND ID --- */
.ig-profile-container { max-width: 900px; margin: 0 auto; }
.ig-member-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ig-member-search { position: relative; flex: 1; min-width: 240px; max-width: 440px; }

.ig-stories-strip {
  display: flex; gap: 16px; overflow-x: auto; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
}
.ig-story-item { display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; width: 72px; flex-shrink: 0; border: none; background: transparent; padding: 0; font-family: inherit; }
.ig-story-name { font-size: 0.74rem; color: var(--ink-secondary); max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ig-cover-strip { height: 175px; border-radius: 16px; overflow: hidden; border: 1px solid var(--border); }
.ig-cover-strip img { width: 100%; height: 100%; object-fit: cover; display: block; }

.ig-profile-header {
  position: relative;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  padding: 14px 8px 20px 8px;
  border-radius: 22px;
  transition: background 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}
.ig-profile-avatar-col { display: flex; justify-content: center; position: relative; z-index: 2; }
.ig-profile-meta { position: relative; z-index: 2; }

/* ==========================================================================
   HIỆU ỨNG PROFILE CỘT MỐC P2P: 100+ (SAPPHIRE AURORA) & 1.000+ (DIAMOND PRISM)
   ========================================================================== */
.p2p-prestige-fx {
  display: none;
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: inherit;
  z-index: 1;
}

/* MỐC 1: 100+ GIAO DỊCH P2P THÀNH CÔNG — SAPPHIRE AURORA */
.ig-profile-header.is-tier-100 {
  padding: 22px 24px;
  border: 1px solid rgba(56, 189, 248, 0.32);
  background:
    radial-gradient(460px 240px at 14% 48%, rgba(56, 189, 248, 0.14), transparent 68%),
    radial-gradient(380px 220px at 90% 10%, rgba(16, 185, 129, 0.09), transparent 66%),
    linear-gradient(150deg, rgba(17, 22, 33, 0.94), rgba(11, 15, 24, 0.96));
  box-shadow:
    0 18px 46px rgba(2, 6, 23, 0.42),
    inset 0 1px 0 rgba(125, 211, 252, 0.22);
}
[data-theme="light"] .ig-profile-header.is-tier-100 {
  border-color: rgba(37, 99, 235, 0.26);
  background:
    radial-gradient(460px 240px at 14% 48%, rgba(56, 189, 248, 0.16), transparent 68%),
    radial-gradient(380px 220px at 90% 10%, rgba(16, 185, 129, 0.1), transparent 66%),
    linear-gradient(150deg, #ffffff, #f0f7ff);
  box-shadow: 0 14px 36px rgba(37, 99, 235, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* MỐC 2: 1.000+ GIAO DỊCH P2P THÀNH CÔNG — PRISMATIC DIAMOND LEGEND */
.ig-profile-header.is-tier-1000 {
  padding: 24px 26px;
  border: 1px solid rgba(167, 139, 250, 0.42);
  background:
    radial-gradient(500px 260px at 14% 50%, rgba(56, 189, 248, 0.2), transparent 66%),
    radial-gradient(420px 260px at 84% 16%, rgba(167, 139, 250, 0.2), transparent 66%),
    radial-gradient(340px 220px at 62% 96%, rgba(52, 211, 153, 0.13), transparent 64%),
    linear-gradient(145deg, rgba(16, 20, 34, 0.96), rgba(9, 12, 21, 0.98));
  box-shadow:
    0 22px 58px rgba(37, 99, 235, 0.2),
    0 0 0 1px rgba(56, 189, 248, 0.16),
    inset 0 1px 0 rgba(224, 242, 254, 0.34);
}
[data-theme="light"] .ig-profile-header.is-tier-1000 {
  border-color: rgba(124, 58, 237, 0.3);
  background:
    radial-gradient(500px 260px at 14% 50%, rgba(56, 189, 248, 0.2), transparent 66%),
    radial-gradient(420px 260px at 84% 16%, rgba(167, 139, 250, 0.2), transparent 66%),
    radial-gradient(340px 220px at 62% 96%, rgba(16, 185, 129, 0.14), transparent 64%),
    linear-gradient(145deg, #ffffff, #f3f1ff 58%, #eef7ff);
  box-shadow: 0 18px 46px rgba(99, 102, 241, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}
.ig-profile-header.is-tier-1000 .p2p-prestige-fx {
  display: block;
}
.ig-profile-header.is-tier-1000 .p2p-prestige-fx::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: conic-gradient(
    from 0deg at 50% 50%,
    transparent 0deg,
    rgba(56, 189, 248, 0.08) 70deg,
    transparent 130deg,
    rgba(167, 139, 250, 0.1) 210deg,
    transparent 270deg,
    rgba(52, 211, 153, 0.08) 325deg,
    transparent 360deg
  );
  animation: p2pHaloSpin 18s linear infinite;
}

/* 4 ngôi sao kim cương lấp lánh tinh tế cho mốc 1.000+ */
.p2p-sparkle {
  position: absolute;
  width: 12px;
  height: 12px;
  background: linear-gradient(135deg, #ffffff, #7dd3fc 55%, #c4b5fd);
  clip-path: polygon(50% 0%, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0% 50%, 38% 38%);
  opacity: 0;
  animation: p2pStarTwinkle 3.8s ease-in-out infinite;
}
.p2p-sparkle.sp-1 { top: 18px; right: 28px; animation-delay: 0s; width: 14px; height: 14px; }
.p2p-sparkle.sp-2 { top: 54px; right: 92px; animation-delay: 1.1s; width: 9px; height: 9px; }
.p2p-sparkle.sp-3 { bottom: 24px; right: 48px; animation-delay: 2.2s; width: 11px; height: 11px; }
.p2p-sparkle.sp-4 { top: 22px; left: 26px; animation-delay: 1.6s; width: 10px; height: 10px; }

/* Vòng hào quang xoay quanh Avatar (giữ ảnh avatar đứng yên 100%, chỉ xoay vòng sáng) */
.ig-ring.is-tier-100,
.ig-ring.is-tier-1000 {
  position: relative;
  background: transparent;
  isolation: isolate;
}
.ig-ring.is-tier-100 > *,
.ig-ring.is-tier-1000 > * {
  position: relative;
  z-index: 2;
}
.ig-ring.is-tier-100::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    #38bdf8 0deg,
    #2563eb 90deg,
    #34d399 180deg,
    #7dd3fc 270deg,
    #38bdf8 360deg
  );
  animation: p2pHaloSpin 6.5s linear infinite;
  z-index: 1;
}
.ig-ring.ig-ring-lg.is-tier-100 {
  padding: 4.5px;
  box-shadow: 0 0 36px rgba(56, 189, 248, 0.42), 0 0 12px rgba(52, 211, 153, 0.24);
}
.ig-ring.is-tier-1000::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    #e0f2fe 0deg,
    #38bdf8 72deg,
    #818cf8 144deg,
    #c084fc 216deg,
    #34d399 288deg,
    #e0f2fe 360deg
  );
  animation: p2pHaloSpin 4.4s linear infinite;
  z-index: 1;
}
.ig-ring.ig-ring-lg.is-tier-1000 {
  padding: 5px;
  box-shadow:
    0 0 44px rgba(129, 140, 248, 0.52),
    0 0 22px rgba(56, 189, 248, 0.42);
}
.ig-ring.ig-ring-lg.is-tier-1000::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1.5px solid rgba(167, 139, 250, 0.48);
  animation: p2pCoronaPulse 2.8s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

/* Huy hiệu nổi đính trên vòng Avatar */
.p2p-ring-crest {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  border: 1.5px solid var(--avatar-ring-gap);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.38);
}
.p2p-ring-crest.tier-100 {
  background: linear-gradient(135deg, #0284c7, #2563eb 55%, #10b981);
  color: #ffffff;
}
.p2p-ring-crest.tier-1000 {
  background: linear-gradient(135deg, #38bdf8, #6366f1 48%, #a855f7 82%, #34d399);
  color: #ffffff;
  box-shadow: 0 6px 22px rgba(129, 140, 248, 0.52);
}

/* Tên tài khoản ánh kim theo cột mốc */
.ig-username-title.is-tier-100 {
  background: linear-gradient(90deg, #e0f2fe 0%, #38bdf8 55%, #6ee7b7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
[data-theme="light"] .ig-username-title.is-tier-100 {
  background: linear-gradient(90deg, #0f172a 0%, #1d4ed8 58%, #059669 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.ig-username-title.is-tier-1000 {
  background: linear-gradient(95deg, #ffffff 0%, #7dd3fc 28%, #c4b5fd 58%, #6ee7b7 82%, #ffffff 100%);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: p2pTextShimmer 5.5s linear infinite;
}
[data-theme="light"] .ig-username-title.is-tier-1000 {
  background: linear-gradient(95deg, #1e1b4b 0%, #2563eb 32%, #7c3aed 64%, #059669 92%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: p2pTextShimmer 5.5s linear infinite;
}

/* Huy hiệu Cột mốc ánh sáng quét ngang */
.p2p-tier-badge {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: -0.005em;
  vertical-align: middle;
}
.p2p-tier-badge::after {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(105deg, transparent 20%, rgba(255, 255, 255, 0.36) 50%, transparent 80%);
  animation: p2pShineSweep 4.2s ease-in-out infinite;
  pointer-events: none;
}
.p2p-tier-badge.tier-100 {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.16), rgba(16, 185, 129, 0.16));
  border: 1px solid rgba(56, 189, 248, 0.44);
  color: #7dd3fc;
}
[data-theme="light"] .p2p-tier-badge.tier-100 {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(16, 185, 129, 0.12));
  border-color: rgba(37, 99, 235, 0.32);
  color: #1d4ed8;
}
.p2p-tier-badge.tier-1000 {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.22), rgba(139, 92, 246, 0.26), rgba(52, 211, 153, 0.2));
  border: 1px solid rgba(196, 181, 253, 0.56);
  color: #f5f3ff;
  box-shadow: 0 4px 18px rgba(129, 140, 248, 0.28);
}
[data-theme="light"] .p2p-tier-badge.tier-1000 {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(124, 58, 237, 0.16), rgba(16, 185, 129, 0.12));
  border-color: rgba(124, 58, 237, 0.38);
  color: #5b21b6;
}
.p2p-tier-badge-xs {
  padding: 2px 7px;
  font-size: 0.67rem;
  margin-left: 5px;
}

/* Dải tiến độ & vinh danh mốc 100 / 1.000 P2P tinh gọn trong Profile */
.p2p-prestige-strip {
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.025);
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 480px;
}
[data-theme="light"] .p2p-prestige-strip {
  background: rgba(15, 23, 42, 0.025);
}
.p2p-prestige-strip.tier-100 {
  border-color: rgba(56, 189, 248, 0.3);
  background: rgba(56, 189, 248, 0.07);
}
.p2p-prestige-strip.tier-1000 {
  border-color: rgba(167, 139, 250, 0.38);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.09), rgba(139, 92, 246, 0.11));
}
.p2p-prestige-strip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.77rem;
  color: var(--ink-secondary);
}
.p2p-prestige-strip-row strong {
  color: var(--ink);
  font-weight: 700;
}
.p2p-prestige-bar {
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: var(--border-soft);
  overflow: hidden;
}
.p2p-prestige-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #38bdf8, #2563eb, #10b981);
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.p2p-prestige-strip.tier-1000 .p2p-prestige-bar-fill {
  background: linear-gradient(90deg, #38bdf8, #818cf8, #c084fc, #34d399);
}
.p2p-count-tier-100 strong { color: #38bdf8; }
.p2p-count-tier-1000 strong { color: #c4b5fd; }
[data-theme="light"] .p2p-count-tier-100 strong { color: #1d4ed8; }
[data-theme="light"] .p2p-count-tier-1000 strong { color: #6d28d9; }

.p2p-preview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 4px;
  margin-top: 2px;
  border-top: 1px solid var(--border-soft);
  font-size: 0.72rem;
  color: var(--muted);
}
.p2p-preview-btns {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.p2p-preview-chip {
  appearance: none;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 2px 9px;
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}
.p2p-preview-chip:hover {
  color: var(--ink);
  border-color: rgba(56, 189, 248, 0.45);
}
.p2p-preview-chip.active.chip-100 {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.55);
  color: #7dd3fc;
}
.p2p-preview-chip.active.chip-1000 {
  background: rgba(139, 92, 246, 0.22);
  border-color: rgba(196, 181, 253, 0.62);
  color: #ede9fe;
}
[data-theme="light"] .p2p-preview-chip.active.chip-100 { color: #1d4ed8; }
[data-theme="light"] .p2p-preview-chip.active.chip-1000 { color: #5b21b6; }

@keyframes p2pHaloSpin {
  to { transform: rotate(360deg); }
}
@keyframes p2pCoronaPulse {
  0%, 100% { transform: scale(1); opacity: 0.55; }
  50% { transform: scale(1.06); opacity: 0.18; }
}
@keyframes p2pShineSweep {
  0%, 62% { left: -120%; }
  100% { left: 160%; }
}
@keyframes p2pTextShimmer {
  to { background-position: 220% center; }
}
@keyframes p2pStarTwinkle {
  0%, 100% { opacity: 0; transform: scale(0.45) rotate(0deg); }
  45% { opacity: 0.92; transform: scale(1.05) rotate(45deg); }
  70% { opacity: 0.25; transform: scale(0.7) rotate(90deg); }
}
@media (prefers-reduced-motion: reduce) {
  .ig-ring.is-tier-100::before,
  .ig-ring.is-tier-1000::before,
  .ig-ring.ig-ring-lg.is-tier-1000::after,
  .ig-profile-header.is-tier-1000 .p2p-prestige-fx::before,
  .p2p-sparkle,
  .p2p-tier-badge::after,
  .ig-username-title.is-tier-1000 {
    animation: none !important;
  }
}
.ig-avatar-edit-btn {
  position: absolute; bottom: 6px; right: 36px; width: 34px; height: 34px;
  border-radius: 50%; border: 2px solid var(--avatar-ring-gap);
  background: var(--accent-grad); color: var(--accent-ink);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.42);
}

.ig-profile-meta { display: flex; flex-direction: column; gap: 12px; }
.ig-profile-row1 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ig-username-title { margin: 0; font-size: 1.38rem; font-weight: 700; letter-spacing: -0.02em; }
.ig-profile-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ig-profile-counts { display: flex; gap: 24px; flex-wrap: wrap; font-size: 0.94rem; color: var(--ink-secondary); }
.ig-profile-counts strong { font-weight: 700; color: var(--ink); font-family: var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: -0.015em; }

.ig-friend-id-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ig-friend-id-pill {
  display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 6px 10px 6px 13px; border-radius: 14px;
  background: var(--info-bg); border: 1px solid var(--info-border);
  font-size: 0.82rem;
}
.ig-friend-id-link {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  color: var(--ink-secondary);
  text-decoration: none;
  word-break: break-all;
}
.ig-friend-id-link:hover { color: var(--accent); }
.ig-friend-id-code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-weight: 800; color: var(--accent); letter-spacing: 0.03em; }
.ig-friend-locked-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 999px;
  background: var(--safe-bg); border: 1px solid var(--safe-border);
  color: var(--safe); font-size: 0.72rem; font-weight: 700;
}
.ig-custom-link-group {
  display: flex; align-items: stretch;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--input-bg);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.ig-custom-link-group:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--info-bg);
}
.ig-custom-link-prefix {
  display: inline-flex; align-items: center;
  padding: 10px 10px 10px 13px;
  background: var(--surface-soft);
  border-right: 1px solid var(--border-soft);
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.84rem;
  white-space: nowrap;
  user-select: none;
}
.ig-custom-link-input {
  flex: 1; min-width: 0; border: none; background: transparent;
  padding: 10px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.92rem; font-weight: 700; color: var(--ink);
}
.ig-custom-link-input:focus { outline: none; }
.ig-custom-link-status {
  margin-top: 6px; font-size: 0.8rem; font-weight: 600; min-height: 1.2em;
}
.ig-custom-link-status.ok { color: var(--safe); }
.ig-custom-link-status.err { color: var(--danger); }
.ig-custom-link-status.checking { color: var(--muted); }
.ig-lock-confirm-check {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 10px 12px; border-radius: 11px;
  background: var(--surface-soft); border: 1px solid var(--border-soft);
  font-size: 0.82rem; color: var(--ink-secondary); cursor: pointer;
}
.ig-lock-confirm-check input { margin-top: 2px; accent-color: var(--accent); flex-shrink: 0; }

/* iOS-style Privacy Toggle Switch (Cài đặt tài khoản) */
.ig-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  padding: 4px 0;
}
.ig-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}
.ig-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.ig-switch-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--btn-sec-bg);
  border: 1px solid var(--border);
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.ig-switch-slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #cbd5e1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), background 0.2s ease;
}
.ig-switch input:checked + .ig-switch-slider {
  background: var(--accent-grad);
  border-color: rgba(56, 189, 248, 0.65);
  box-shadow: 0 0 14px rgba(37, 99, 235, 0.42);
}
.ig-switch input:checked + .ig-switch-slider::before {
  transform: translateX(20px);
  background: #ffffff;
}
.ig-input:disabled,
.ig-custom-link-input:disabled {
  opacity: 0.56;
  cursor: not-allowed;
}

/* Điều lệ Website (Pháp luật VN) & Khóa cố định 1 STK ngân hàng (AML) */
.ig-terms-box {
  padding: 11px 13px;
  border-radius: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--ink-secondary);
}
.ig-terms-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--ink);
  font-size: 0.8rem;
}
.ig-terms-brief {
  margin: 0;
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  line-height: 1.42;
}
.ig-terms-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--border-soft);
  cursor: pointer;
  color: var(--ink);
  font-size: 0.8rem;
  line-height: 1.4;
}
.ig-terms-check input {
  margin-top: 2px;
  accent-color: var(--accent);
  flex-shrink: 0;
}
.ig-terms-modal {
  max-width: 660px;
  width: 100%;
}
.ig-terms-scroll {
  max-height: 58vh;
  overflow-y: auto;
  padding-right: 6px;
}
.ig-terms-article {
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--ink-secondary);
}
.ig-terms-article h3 {
  margin: 0 0 6px 0;
  font-size: 0.9rem;
  color: var(--ink);
}
.ig-terms-article p { margin: 0 0 6px 0; }
.ig-terms-article ul {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.p2p-aml-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 13px 16px;
  border-radius: 14px;
  border: 1px solid var(--safe-border);
  background: var(--safe-bg);
}
.p2p-aml-bar.unlocked {
  border-color: var(--warn-border);
  background: var(--warn-bg);
}
.ig-friend-add-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ig-friend-add-form input { flex: 1; min-width: 210px; }

.ig-fullname { font-weight: 700; font-size: 0.96rem; margin-bottom: 3px; }
.ig-bio-lines { font-size: 0.9rem; color: var(--ink-secondary); display: flex; flex-direction: column; gap: 3px; }

.ig-profile-tabs { border-top: 1px solid var(--border); display: flex; justify-content: center; gap: 28px; overflow-x: auto; }
.ig-ptab {
  border: none; border-top: 2px solid transparent; margin-top: -1px;
  background: transparent; padding: 14px 4px;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.07em;
  color: var(--muted); cursor: pointer; white-space: nowrap; font-family: inherit;
}
.ig-ptab.active { color: var(--accent); border-top-color: var(--accent); }

/* Posts */
.ig-feed-column { max-width: 610px; margin: 0 auto; width: 100%; }
.ig-composer-row { display: flex; gap: 12px; align-items: flex-start; }
.ig-composer-textarea { flex: 1; border: none; resize: none; font-size: 0.94rem; font-family: inherit; padding: 6px 0; background: transparent; color: var(--ink); }
.ig-composer-textarea::placeholder { color: var(--muted); }
.ig-composer-textarea:focus { outline: none; }
.ig-composer-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 10px; border-top: 1px solid var(--border-soft); flex-wrap: wrap; }

.ig-post { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; box-shadow: var(--card-shadow), var(--specular); }
.ig-post-head { padding: 12px 15px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ig-post-user { display: flex; align-items: center; gap: 10px; }
.ig-post-photo { width: 100%; max-height: 540px; object-fit: cover; display: block; cursor: zoom-in; background: #020617; }
.ig-post-body-wrap { padding: 12px 15px 14px 15px; display: flex; flex-direction: column; gap: 8px; }
.ig-post-action-row { display: flex; align-items: center; gap: 14px; }
.ig-heart-btn { border: none; background: transparent; padding: 2px; cursor: pointer; color: var(--ink); display: inline-flex; align-items: center; transition: transform 0.12s ease; }
.ig-heart-btn:hover { opacity: 0.75; }
.ig-heart-btn:active { transform: scale(1.18); }
.ig-heart-btn.liked { color: var(--danger-solid); }
.ig-heart-btn.liked svg { fill: var(--danger-solid); stroke: var(--danger-solid); }

.ig-post-caption { font-size: 0.92rem; white-space: pre-wrap; color: var(--ink-secondary); }
.ig-comment-line { font-size: 0.87rem; display: flex; gap: 6px; align-items: baseline; color: var(--ink-secondary); }
.ig-comment-bar { display: flex; align-items: center; gap: 8px; padding: 10px 15px; border-top: 1px solid var(--border-soft); }
.ig-comment-input { border: none; flex: 1; font-size: 0.88rem; font-family: inherit; background: transparent; color: var(--ink); }
.ig-comment-input::placeholder { color: var(--muted); }
.ig-comment-input:focus { outline: none; }

/* Auth Box & OTP */
.ig-auth-landing { max-width: 400px; margin: 16px auto; display: flex; flex-direction: column; gap: 12px; }
.ig-auth-box {
  background: var(--surface); backdrop-filter: blur(16px);
  border: 1px solid var(--border); border-radius: 16px;
  padding: 32px 30px 24px 30px; text-align: center;
  box-shadow: var(--card-shadow), var(--specular);
}
.ig-auth-logo {
  font-size: 2rem; font-weight: 900; letter-spacing: -0.04em;
  text-align: center; margin-bottom: 14px;
  background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.ig-or-line { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 0.74rem; font-weight: 700; margin: 6px 0; }
.ig-or-line::before, .ig-or-line::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.ig-otp-box-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 5px; margin-bottom: 4px; }
.ig-otp-mail-ico {
  width: 54px; height: 54px; border-radius: 50%;
  border: 1px solid var(--info-border); background: var(--info-bg); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center; margin-bottom: 4px;
}
.ig-otp-input { text-align: center; font-size: 1.5rem; font-weight: 700; letter-spacing: 0.36em; font-family: var(--font-mono); font-variant-numeric: tabular-nums; padding: 12px; }

.profile-link { color: var(--ink); font-weight: 700; text-decoration: none; cursor: pointer; }
.profile-link:hover { color: var(--accent); }

/* Stars, Timeline, Modals, Toasts */
.star-picker { display: flex; align-items: center; gap: 3px; }
.star-btn { border: none; background: transparent; font-size: 1.45rem; cursor: pointer; color: var(--muted); padding: 0 2px; }
.star-btn.active { color: #fbbf24; }

.timeline { border-left: 1.5px solid var(--border); padding-left: 14px; display: flex; flex-direction: column; gap: 10px; }
.timeline-item { position: relative; }
.timeline-item::before { content: ""; position: absolute; left: -19px; top: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.timeline-item.role-admin::before { background: var(--purple); }
.timeline-item.role-seller::before { background: var(--safe); }

.modal-backdrop { position: fixed; inset: 0; background: var(--modal-backdrop); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 60; overflow-y: auto; }
.modal { background: var(--surface-solid); border: 1px solid var(--border); border-radius: 18px; padding: 24px; max-width: 440px; width: 100%; position: relative; box-shadow: 0 28px 72px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(56, 189, 248, 0.14), var(--specular); animation: modalSpring 0.24s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes modalSpring {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.ig-auth-modal { max-width: 450px; }
.ig-modal-x { position: absolute; top: 14px; right: 14px; border: 1px solid var(--border); background: var(--surface-soft); color: var(--ink); width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-weight: 700; transition: all 0.16s ease; }
.ig-modal-x:hover { border-color: var(--accent); color: var(--accent); }
.ig-auth-tabs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; background: var(--input-bg); border: 1px solid var(--border); padding: 4px; border-radius: 11px; margin-bottom: 16px; }
.auth-tab { border: none; background: transparent; padding: 8px; border-radius: 8px; font-size: 0.88rem; font-weight: 600; color: var(--muted); cursor: pointer; font-family: inherit; transition: all 0.16s ease; }
.auth-tab.active { background: var(--accent-grad); color: var(--accent-ink); font-weight: 800; }

.lightbox-inner { position: relative; max-width: 90vw; max-height: 90vh; }
.lightbox-inner img { max-width: 90vw; max-height: 85vh; border-radius: 12px; display: block; border: 1px solid var(--border); }
.lightbox-close { position: absolute; top: -42px; right: 0; }

.toast-container { position: fixed; bottom: 22px; right: 22px; z-index: 70; display: flex; flex-direction: column; gap: 8px; max-width: 350px; }
.toast { background: #11141b; border: 1px solid rgba(56, 189, 248, 0.38); border-left: 3px solid #38bdf8; color: #f1f5f9; padding: 11px 15px; border-radius: 12px; font-size: 0.86rem; box-shadow: 0 14px 34px rgba(0, 0, 0, 0.48); animation: modalSpring 0.22s ease; }
.toast.error { background: #2a1219; border-color: rgba(246, 70, 93, 0.48); border-left-color: #f6465d; color: #ffd4db; }
.toast.success { background: #0d261d; border-color: rgba(14, 203, 129, 0.48); border-left-color: #0ecb81; color: #c7f9e5; }

/* --- RESPONSIVE: iPAD (PRO / AIR / MINI), iPHONE (DYNAMIC ISLAND / SE) & ANDROID --- */
.ig-rail-only { display: none; }

/* Ẩn thanh cuộn xấu trên dải cuộn ngang cảm ứng & kích hoạt cuộn quán tính mượt */
.bn-live-bar,
.ig-dm-quick,
.ig-stories-strip,
.ig-profile-tabs {
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}
.bn-live-bar::-webkit-scrollbar,
.ig-dm-quick::-webkit-scrollbar,
.ig-stories-strip::-webkit-scrollbar,
.ig-profile-tabs::-webkit-scrollbar {
  display: none;
}
.ig-dm-messages,
.ig-terms-scroll {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

@keyframes mobileSheetUp {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Chống dính hiệu ứng :hover trên màn hình cảm ứng (iPhone, iPad, Android) */
@media (hover: none) {
  .ig-card:hover { border-color: var(--border); }
  .ig-card:hover::before { opacity: 0; }
  .ig-btn-primary:hover:not(:disabled) { transform: none; filter: none; box-shadow: var(--accent-glow); }
  .ig-btn-primary:hover:not(:disabled)::after { left: -120%; }
  .ig-btn-safe:hover:not(:disabled),
  .ig-btn-danger:hover:not(:disabled),
  .ig-btn-amber:hover:not(:disabled) { transform: none; filter: none; }
  .p2p-order-card:hover { transform: none; box-shadow: none; border-color: var(--border); }
  .ig-nav-item:hover { transform: none; }
}

/* Chống iOS Safari / iPadOS tự động phóng to màn hình khi chạm vào ô nhập liệu (< 16px) */
@media (pointer: coarse), (max-width: 1024px) {
  .ig-input,
  .ig-search-pill,
  .ig-dm-input,
  .ig-comment-input,
  .ig-composer-textarea,
  .ig-custom-link-input,
  select.ig-input,
  textarea.ig-input {
    font-size: 16px;
  }
  .ig-icon-btn { min-width: 40px; min-height: 40px; }
  .ig-modal-x { width: 36px; height: 36px; }
}

/* iPad Pro 11" / iPad Air / iPad Mini (768px – 1180px): Thanh Rail gọn bên trái, giữ Split-View P2P khi xoay ngang (>=1024px) */
@media (max-width: 1180px) {
  :root, [data-theme="dark"], [data-theme="light"] { --sidebar-w: 78px; }
  .ig-sidebar {
    padding-left: max(8px, env(safe-area-inset-left));
    padding-right: 8px;
  }
  .ig-brand-text, .ig-nav-label, .ig-sidebar-footer .ig-btn-full { display: none; }
  .ig-rail-only { display: inline-flex; }
  .ig-brand { justify-content: center; padding: 6px 0 20px 0; }
  .ig-nav-item, .ig-theme-toggle { justify-content: center; padding: 12px 0; min-height: 48px; }
  .ig-sidebar-footer { align-items: center; }
  .ig-content-wrap { padding: 24px 20px 56px 20px; }
  .p2p-room-grid { grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.96fr); gap: 14px; }
}

/* iPad dọc (Portrait <= 1023px): Chuyển phòng P2P sang dọc cho khung chat & QR rộng rãi */
@media (max-width: 1023px) {
  .p2p-room-grid { grid-template-columns: 1fr; }
  .ig-dm-panel { position: static; height: min(64dvh, 560px); }
}

/* iPad Mini dọc & Tablet cỡ nhỏ (<= 900px) */
@media (max-width: 900px) {
  .ig-two-col, .ig-two-col-even, .p2p-order-card, .ig-search-row { grid-template-columns: 1fr; }
  .lookup-stats-grid, .p2p-metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .ig-profile-header { grid-template-columns: 1fr; text-align: center; justify-items: center; gap: 16px; }
  .ig-profile-meta, .ig-profile-row1, .ig-profile-counts, .ig-profile-actions, .ig-friend-id-row { justify-content: center; }
  .ig-profile-tabs { justify-content: flex-start; gap: 16px; padding: 0 6px; }
  .ig-avatar-edit-btn { right: 8px; }
}

/* iPhone (SE / 14 / 15 / 16 Pro Max) & Điện thoại Android (<= 767px) */
@media (max-width: 767px) {
  :root, [data-theme="dark"], [data-theme="light"] { --sidebar-w: 0px; }
  .ig-mobile-header { display: flex; }

  /* Thanh Bottom Tab Bar chuẩn App iOS/Android với nhãn rõ ràng & Safe Area Home Indicator */
  .ig-sidebar {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: calc(64px + env(safe-area-inset-bottom));
    flex-direction: row;
    border-right: none;
    border-top: 1px solid var(--border);
    padding: 4px max(6px, env(safe-area-inset-right)) calc(4px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
    align-items: center;
    box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.34);
    transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), background 0.22s ease;
  }
  .ig-brand, .ig-theme-toggle, .ig-sidebar-footer { display: none; }
  .ig-nav {
    flex-direction: row;
    justify-content: space-around;
    align-items: stretch;
    width: 100%;
    gap: 2px;
  }
  .ig-nav-item {
    flex: 1;
    width: auto;
    min-width: 0;
    min-height: 52px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 3px;
    padding: 6px 2px;
    border: none;
    border-radius: 10px;
    background: transparent;
  }
  .ig-nav-item.active {
    background: transparent;
    border-color: transparent;
    color: var(--accent);
  }
  .ig-nav-item.active::before {
    left: 22%;
    right: 22%;
    top: -4px;
    bottom: auto;
    width: auto;
    height: 3px;
    border-radius: 0 0 4px 4px;
  }
  .ig-nav-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    letter-spacing: -0.01em;
  }
  .ig-dot-badge {
    top: -5px;
    right: -7px;
    min-width: 16px;
    height: 16px;
    font-size: 0.6rem;
  }

  /* Ẩn gọn thanh Bottom Tab Bar khi người dùng đang bật bàn phím ảo trên iPhone/Android */
  body.kb-open .ig-sidebar {
    transform: translateY(115%);
    pointer-events: none;
  }
  body.kb-open .ig-main {
    padding-bottom: 16px;
  }
  body.kb-open .toast-container {
    bottom: 14px;
  }

  /* Nội dung chính & Live Ticker không chiếm dính không gian màn hình nhỏ */
  .ig-main {
    margin-left: 0;
    padding-top: calc(56px + env(safe-area-inset-top));
    padding-bottom: calc(74px + env(safe-area-inset-bottom));
  }
  .bn-live-bar {
    position: static;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 8px 12px;
    gap: 5px 10px;
    font-size: 0.71rem;
    overflow-x: visible;
  }
  .bn-live-left, .bn-live-metrics {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }
  .bn-live-left {
    padding-bottom: 5px;
    border-bottom: 1px solid var(--border-soft);
  }
  .bn-live-left .bn-metric-sep { display: none; }
  .ig-content-wrap {
    padding: 14px 12px 24px 12px;
  }
  .ig-section-head { margin-bottom: 14px; }
  .ig-section-head h1 { font-size: 1.24rem; line-height: 1.25; }
  .ig-section-head p { font-size: 0.85rem; }
  .ig-card { padding: 15px 14px; border-radius: 15px; }

  /* Form & Nút bấm chuẩn chạm ngón tay (Apple HIG >= 44px) */
  .form-row-2, .form-row-3 { grid-template-columns: 1fr; }
  .ig-btn { min-height: 42px; }
  .ig-btn-lg { min-height: 46px; width: 100%; }
  .ig-btn-sm { min-height: 36px; }
  .ig-btn-xs { min-height: 32px; }
  #analyzer-form .btn-row { flex-wrap: nowrap; }
  #analyzer-form #analyze-submit-btn { flex: 1; width: auto; }
  #analyzer-form #analyze-clear-btn { flex-shrink: 0; min-height: 46px; padding: 0 16px; }

  /* P2P Hub, Phòng riêng tư, QR & Live Chat mượt mà trên di động */
  .p2p-quick-hub { flex-direction: column; align-items: stretch; gap: 10px; }
  .p2p-hub-create, .p2p-hub-create .ig-btn { width: 100%; }
  .p2p-join-form { max-width: none; min-width: 0; width: 100%; }
  .p2p-join-form .ig-btn { width: auto; flex-shrink: 0; padding: 0 18px; }
  .p2p-invite-strip { flex-direction: column; align-items: stretch; text-align: center; gap: 10px; }
  .p2p-invite-strip .ig-btn { width: 100%; }
  .p2p-order-card { padding: 14px; gap: 10px; }
  .p2p-order-card .ig-btn { width: 100%; }
  .p2p-room-topbar { gap: 8px; }
  .p2p-order-banner { padding: 14px 15px; gap: 10px; }
  .p2p-banner-title { font-size: 1.02rem; }
  .p2p-banner-meta { text-align: left; width: 100%; }
  .p2p-stepper { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .payment-box { flex-direction: column; align-items: stretch; gap: 12px; padding: 14px; }
  .qr-svg-wrap { margin: 0 auto; width: 164px; height: 164px; }
  .payment-kv-list { min-width: 0; }
  .payment-kv { flex-wrap: wrap; gap: 4px 10px; }
  .ig-dm-panel { height: min(68dvh, 520px); min-height: 380px; border-radius: 16px; }
  .ig-dm-header { padding: 10px 12px; }
  .ig-dm-messages { padding: 12px 10px; }
  .chat-msg-row { max-width: 88%; }
  .chat-img-thumb { max-width: 185px; max-height: 185px; }
  .ig-dm-composer-wrap { padding: 8px 10px 10px 10px; }
  .ig-dm-send { min-height: 36px; padding: 4px 10px; }
  .p2p-aml-bar { padding: 12px 13px; }
  .p2p-aml-bar .ig-btn { width: 100%; }

  /* Báo cáo Scam 2 mục & Profile trên di động */
  .rep-step-box { padding: 12px; }
  .rep-dual-grid { grid-template-columns: 1fr; }
  .ig-member-topbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .ig-member-search { max-width: none; min-width: 0; width: 100%; }
  .ig-avatar-xl { width: 104px; height: 104px; font-size: 2rem; }
  .ig-profile-counts { gap: 16px; font-size: 0.86rem; }
  .ig-profile-tabs { justify-content: flex-start; gap: 18px; padding: 0 4px; }
  .ig-friend-id-pill { width: 100%; justify-content: center; }
  .ig-custom-link-prefix { font-size: 0.76rem; padding: 10px 8px 10px 10px; }
  .ig-auth-box { padding: 24px 18px 20px 18px; }

  /* Biến Modal thành Bottom-Sheet trượt từ đáy chuẩn iOS/Android */
  .modal-backdrop:not(#lightbox-modal) {
    align-items: flex-end;
    padding: 0;
  }
  .modal-backdrop:not(#lightbox-modal) .modal {
    max-width: 100%;
    width: 100%;
    border-radius: 22px 22px 0 0;
    border-bottom: none;
    padding: 18px 16px calc(20px + env(safe-area-inset-bottom)) 16px;
    max-height: 92dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    animation: mobileSheetUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .modal-backdrop:not(#lightbox-modal) .modal::before {
    content: "";
    display: block;
    width: 40px;
    height: 4px;
    border-radius: 999px;
    background: var(--border);
    margin: -4px auto 12px auto;
  }
  .ig-terms-scroll { max-height: 54dvh; }
  .lightbox-inner { max-width: 96vw; max-height: 88dvh; }
  .lightbox-inner img { max-width: 96vw; max-height: 76dvh; }
  .lightbox-close { top: -46px; right: 0; min-height: 38px; }

  /* Toast hiển thị nổi phía trên thanh Bottom Tab Bar */
  .toast-container {
    left: 12px;
    right: 12px;
    bottom: calc(74px + env(safe-area-inset-bottom));
    max-width: none;
  }
}

/* Màn hình điện thoại nhỏ (iPhone SE 375px / iPhone Mini / Android 360px) */
@media (max-width: 390px) {
  .ig-mobile-header { padding-left: 10px; padding-right: 10px; }
  .ig-mobile-auth .ig-btn-xs { padding: 4px 8px; font-size: 0.72rem; min-height: 32px; }
  .ig-nav-label { font-size: 0.6rem; }
  .ig-content-wrap { padding: 12px 10px 22px 10px; }
  .cvf-amounts { grid-template-columns: 1fr; }
  .lookup-stats-grid, .p2p-metrics-grid { gap: 6px; }
}
