/* ==========================================================================
   IG Gold — Obsidian & Champagne Gold Institutional Design System
   High-Craft Luxury Financial UI Stylesheet (PC Web + WebTrader + Mobile App)
   ========================================================================== */

:root {
  /* Obsidian Layered Backgrounds */
  color-scheme: dark;
  accent-color: #D8A444;

  /* Obsidian Layered Backgrounds (Dark / Night Default) */
  --bg-abyss: #050507;
  --bg-obsidian: #090A0D;
  --bg-elevated: #111217;
  --bg-panel: #14151B;
  --bg-panel-warm: #181510;
  --bg-glass: rgba(16, 17, 22, 0.84);
  --bg-topbar: rgba(10, 11, 14, 0.92);
  --bg-tabbar: rgba(13, 13, 17, 0.96);
  --bg-card-top: #16161B;
  --bg-card-bot: #0F1014;
  --bg-dialog-top: #1B1812;
  --bg-dialog-bot: #0E0F14;
  --bg-input: rgba(8, 9, 12, 0.88);
  --bg-select-opt: #121318;
  --bg-quick-icon-top: #211C13;
  --bg-quick-icon-bot: #131317;
  --bg-footer: #040406;

  /* Subtle Surface Overlays */
  --surface-soft: rgba(255, 255, 255, 0.04);
  --surface-field: rgba(255, 255, 255, 0.03);
  --surface-chip: rgba(255, 255, 255, 0.06);
  --surface-hover: rgba(255, 255, 255, 0.08);
  --surface-pill-track: rgba(255, 255, 255, 0.16);

  /* Champagne & Royal Bullion Gold Palette */
  --gold-100: #FFF3CE;
  --gold-200: #FCE29B;
  --gold-300: #F0C66D;
  --gold-400: #D8A444;
  --gold-500: #BD8628;
  --gold-600: #8D5F16;
  --gold-700: #52360A;

  /* Signature Metallic Gradients */
  --grad-gold-btn: linear-gradient(135deg, #F9DF94 0%, #DAA545 50%, #B47B20 100%);
  --grad-gold-btn-hover: linear-gradient(135deg, #FFEAAC 0%, #E7B455 50%, #C68B2C 100%);
  --grad-gold-text: linear-gradient(135deg, #FFF2C6 0%, #F2CA74 45%, #CB9334 100%);
  --grad-card-obsidian: linear-gradient(165deg, rgba(26, 24, 20, 0.94) 0%, rgba(13, 14, 18, 0.98) 100%);
  --grad-asset-vault:
    radial-gradient(120% 95% at 92% 95%, rgba(236, 184, 82, 0.34) 0%, rgba(188, 130, 38, 0.14) 36%, rgba(18, 16, 14, 0) 70%),
    radial-gradient(75% 60% at 78% 82%, rgba(255, 228, 152, 0.22) 0%, transparent 55%),
    linear-gradient(145deg, #211B12 0%, #141210 52%, #0E0E12 100%);

  /* Borders & Specular Highlights */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-row: rgba(255, 255, 255, 0.045);
  --border-control: rgba(255, 255, 255, 0.12);
  --border-gold-dim: rgba(218, 165, 69, 0.18);
  --border-gold-mid: rgba(232, 184, 92, 0.36);
  --border-gold-bright: rgba(252, 226, 155, 0.65);

  /* Typography Colors */
  --text-strong: #FFFFFF;
  --text-primary: #F5F2EB;
  --text-body: #E5E2DA;
  --text-soft: #C9C3B5;
  --text-secondary: #A9A69E;
  --text-muted: #7D7A72;
  --text-dark-gold: #181104;

  /* Market Trading Colors */
  --up-color: #19C87E;
  --up-bright: #28E092;
  --up-bg: rgba(25, 200, 126, 0.14);
  --up-border: rgba(25, 200, 126, 0.30);

  --down-color: #F04A5E;
  --down-bright: #FF6174;
  --down-bg: rgba(240, 74, 94, 0.14);
  --down-border: rgba(240, 74, 94, 0.30);

  /* Scrollbars */
  --scrollbar-track: #08090C;
  --scrollbar-thumb: rgba(216, 164, 68, 0.28);

  /* Shadows */
  --shadow-card: 0 18px 42px -12px rgba(0, 0, 0, 0.78), inset 0 1px 0 rgba(255, 236, 185, 0.08);
  --shadow-gold-glow: 0 10px 28px -6px rgba(216, 164, 68, 0.42), inset 0 1px 1px rgba(255, 250, 224, 0.72);
  --shadow-modal: 0 32px 80px rgba(0, 0, 0, 0.92);

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --radius-pill: 999px;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}


*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg-abyss);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--bg-abyss);
  color: var(--text-primary);
  line-height: 1.55;
  overflow-x: hidden;
}

/* Tabular Monospace Numbers for Prices & Balances */
.num-mono {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.serif-display {
  font-family: 'Cinzel', Georgia, serif;
}

/* Metallic Gold Gradient Text */
.gold-gradient-text {
  background: var(--grad-gold-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Luxury Obsidian Card */
.lux-card {
  background: var(--grad-card-obsidian);
  border: 1px solid var(--border-gold-dim);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  position: relative;
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.28s ease, box-shadow 0.28s ease;
}

.lux-card:hover {
  border-color: var(--border-gold-mid);
}

/* Signature Asset Card with Golden Light Wave (Matches Reference Images 3/4/5) */
.asset-vault-card {
  background: var(--grad-asset-vault);
  border: 1px solid rgba(226, 179, 88, 0.30);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.asset-vault-card::before {
  content: '';
  position: absolute;
  right: -12%;
  bottom: -28%;
  width: 78%;
  height: 92%;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(255, 224, 138, 0.42) 0%, rgba(216, 160, 56, 0.16) 40%, transparent 72%);
  transform: rotate(-16deg);
  pointer-events: none;
  filter: blur(8px);
}

.asset-vault-card::after {
  content: '';
  position: absolute;
  right: -5%;
  bottom: 10%;
  width: 68%;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 235, 175, 0.85) 55%, rgba(218, 165, 69, 0.2) 100%);
  box-shadow: 0 0 16px 2px rgba(252, 216, 122, 0.55);
  transform: rotate(-11deg);
  border-radius: 50%;
  pointer-events: none;
}

/* Buttons */
.btn-gold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--grad-gold-btn);
  color: var(--text-dark-gold);
  font-weight: 700;
  border: none;
  border-radius: var(--radius-pill);
  padding: 12px 28px;
  font-size: 15px;
  cursor: pointer;
  box-shadow: var(--shadow-gold-glow);
  transition: all 0.22s ease;
  text-decoration: none;
  user-select: none;
  white-space: nowrap;
}

.btn-gold:hover {
  background: var(--grad-gold-btn-hover);
  transform: translateY(-1.5px);
  box-shadow: 0 14px 34px -4px rgba(232, 180, 84, 0.56), inset 0 1px 1px rgba(255, 252, 235, 0.85);
}

.btn-gold:active {
  transform: translateY(0);
}

.btn-obsidian {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--surface-soft);
  color: var(--gold-200);
  font-weight: 600;
  border: 1px solid var(--border-gold-mid);
  border-radius: var(--radius-pill);
  padding: 11px 26px;
  font-size: 15px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: all 0.22s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn-obsidian:hover {
  background: rgba(216, 164, 68, 0.14);
  border-color: var(--border-gold-bright);
  color: var(--gold-100);
  transform: translateY(-1px);
}

.btn-buy {
  background: linear-gradient(135deg, #24D88B 0%, #13A868 100%);
  color: #FFFFFF;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  box-shadow: 0 8px 22px -4px rgba(25, 200, 126, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-buy:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-sell {
  background: linear-gradient(135deg, #F65B6E 0%, #D43548 100%);
  color: #FFFFFF;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  box-shadow: 0 8px 22px -4px rgba(240, 74, 94, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-sell:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

/* Price Change Badges */
.badge-change {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}

.badge-up {
  color: var(--up-bright);
  background: var(--up-bg);
  border: 1px solid var(--up-border);
}

.badge-down {
  color: var(--down-bright);
  background: var(--down-bg);
  border: 1px solid var(--down-border);
}

.text-up { color: var(--up-bright) !important; }
.text-down { color: var(--down-bright) !important; }
.text-gold { color: var(--gold-300) !important; }

/* Flash Tick Animations */
@keyframes tickUpFlash {
  0% { background-color: rgba(25, 200, 126, 0.22); }
  100% { background-color: transparent; }
}
@keyframes tickDownFlash {
  0% { background-color: rgba(240, 74, 94, 0.22); }
  100% { background-color: transparent; }
}
.flash-up { animation: tickUpFlash 0.55s ease-out; }
.flash-down { animation: tickDownFlash 0.55s ease-out; }

/* Floating Cross-Platform Mode Switcher Pill */
.platform-dock {
  display: inline-flex;
  align-items: center;
  background: var(--bg-glass);
  border: 1px solid var(--border-gold-mid);
  border-radius: var(--radius-pill);
  padding: 3px;
  gap: 2px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.platform-dock a {
  padding: 6px 13px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.platform-dock a:hover {
  color: var(--gold-100);
}

.platform-dock a.active {
  background: var(--grad-gold-btn);
  color: var(--text-dark-gold);
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(216, 164, 68, 0.35);
}

/* Custom Symbol Icons (Bullion Gold, Silver, Flags, Crypto) */
.sym-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  font-weight: 700;
  font-size: 13px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.sym-gold {
  background: radial-gradient(circle at 30% 30%, #FFF0B8, #D9A23B 60%, #6E4A0C 100%);
  color: #231602;
  border-color: rgba(255, 228, 148, 0.65);
  box-shadow: 0 4px 12px rgba(217, 162, 59, 0.35);
}

.sym-silver {
  background: radial-gradient(circle at 30% 30%, #FFFFFF, #B9C0C9 62%, #59606A 100%);
  color: #16191E;
  border-color: rgba(235, 240, 248, 0.6);
  box-shadow: 0 4px 12px rgba(185, 192, 201, 0.25);
}

.sym-platinum {
  background: radial-gradient(circle at 30% 30%, #F4FAFF, #8EB2D6 62%, #354E69 100%);
  color: #0E1F33;
  border-color: rgba(190, 224, 255, 0.65);
  box-shadow: 0 4px 12px rgba(110, 160, 210, 0.30);
}

.sym-palladium {
  background: radial-gradient(circle at 30% 30%, #F8F0FA, #B098BD 62%, #4B3A57 100%);
  color: #1C1026;
  border-color: rgba(226, 198, 242, 0.62);
  box-shadow: 0 4px 12px rgba(160, 128, 185, 0.28);
}

.sym-btc {
  background: radial-gradient(circle at 30% 30%, #FFB84D, #F7931A 65%, #9E5600 100%);
  color: #FFF;
  border-color: rgba(255, 184, 77, 0.55);
}

.sym-eth {
  background: radial-gradient(circle at 30% 30%, #8EA3F5, #627EEA 65%, #2E4296 100%);
  color: #FFF;
}

.sym-fx {
  background: linear-gradient(135deg, #1E3B70 0%, #102040 100%);
  color: #E8F0FF;
  border-color: rgba(110, 160, 255, 0.38);
}

.sym-idx {
  background: linear-gradient(135deg, #3A2C16 0%, #1B150C 100%);
  color: var(--gold-200);
  border-color: var(--border-gold-mid);
}

/* ==========================================================================
   Native <dialog> Modal & UK Companies House Certificate Lightbox
   ========================================================================== */
dialog.ig-dialog {
  margin: auto;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-primary);
  max-width: 100vw;
  max-height: 100dvh;
  overflow: visible;
}

dialog.ig-dialog:modal {
  overscroll-behavior: contain;
}

dialog.ig-dialog::backdrop {
  background: rgba(4, 4, 7, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: hidden;
  overscroll-behavior: contain;
}

dialog.ig-dialog[open] {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeInModal 0.2s ease-out;
}

/* Bottom Sheet variant for Mobile Quick Trade / Cashier */
dialog.ig-sheet-dialog[open] {
  margin: auto auto 0;
  width: min(460px, 100vw);
  max-width: 100vw;
  align-items: flex-end;
}

.ig-sheet-card {
  width: 100%;
  background: linear-gradient(175deg, var(--bg-dialog-top) 0%, var(--bg-dialog-bot) 100%);
  border: 1px solid var(--border-gold-mid);
  border-bottom: none;
  border-radius: 22px 22px 0 0;
  padding: 20px 18px calc(22px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.88);
  max-height: 88dvh;
  overflow-y: auto;
}

/* High-Contrast Keyboard Focus Ring */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--gold-200);
  outline-offset: 2px;
}

/* Visually Hidden Accessibility Utility */
.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

/* Form Validation Error Styling */
.lux-input[aria-invalid="true"] {
  border-color: var(--down-bright) !important;
  box-shadow: 0 0 0 2px rgba(255, 97, 116, 0.2);
}

.field-hint-text {
  font-size: 11.5px;
  color: var(--text-muted);
  margin: 0 0 6px;
  line-height: 1.45;
}

.field-error-text {
  font-size: 12px;
  color: var(--down-bright);
  margin-top: 5px;
  min-height: 16px;
}

/* Feed Source & Connection Pill */
.feed-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border-control);
  background: var(--surface-soft);
  color: var(--text-secondary);
  white-space: nowrap;
}
.feed-status-pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
}
.feed-status-pill.live {
  border-color: rgba(25, 200, 126, 0.36);
  background: rgba(25, 200, 126, 0.1);
  color: var(--up-bright);
}
.feed-status-pill.live .dot {
  background: var(--up-bright);
  box-shadow: 0 0 8px var(--up-bright);
}
.feed-status-pill.stale {
  border-color: rgba(232, 184, 92, 0.4);
  background: rgba(216, 164, 68, 0.12);
  color: var(--gold-200);
}
.feed-status-pill.stale .dot {
  background: var(--gold-300);
}
.feed-status-pill.offline {
  border-color: rgba(240, 74, 94, 0.4);
  background: rgba(240, 74, 94, 0.12);
  color: var(--down-bright);
}
.feed-status-pill.offline .dot {
  background: var(--down-bright);
}

.cert-lightbox-backdrop {
  padding: 16px;
  outline: none;
  box-sizing: border-box;
}

@keyframes fadeInModal {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.cert-lightbox-shell {
  width: min(1240px, 96vw);
  max-width: 100%;
  height: min(860px, 92dvh);
  background: linear-gradient(160deg, var(--bg-dialog-top) 0%, var(--bg-dialog-bot) 100%);
  border: 1px solid var(--border-gold-mid);
  border-radius: 22px;
  box-shadow: var(--shadow-modal), inset 0 1px 0 rgba(255, 234, 175, 0.2);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  grid-template-rows: auto minmax(0, 1fr) 84px;
  overflow: hidden;
  box-sizing: border-box;
}

.cert-lb-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-gold-dim);
  background: var(--bg-topbar);
  min-width: 0;
  box-sizing: border-box;
}

.cert-lb-head-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.cert-lb-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(216, 164, 68, 0.16);
  border: 1px solid rgba(232, 184, 92, 0.45);
  color: var(--gold-200);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cert-lb-head-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.cert-lb-ctrl-btn {
  padding: 6px 12px;
  font-size: 12px;
  white-space: nowrap;
}

.cert-lb-close-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-control);
  background: var(--surface-hover);
  color: var(--text-strong);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cert-lb-mobile-close {
  display: none;
}

.cert-lb-info-toggle {
  display: none;
}

.cert-lb-stage {
  background: radial-gradient(circle at center, #1B1A17 0%, #09090C 100%);
  position: relative;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  align-items: flex-start;
  justify-content: safe center;
  padding: 24px;
  min-width: 0;
  min-height: 0;
  box-sizing: border-box;
}

.cert-lb-paper-frame {
  background: #FAF8F2;
  padding: 10px;
  border-radius: 6px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85), 0 0 0 2px rgba(218, 165, 69, 0.55);
  transition: width 0.2s ease;
  margin: auto;
  flex: 0 0 auto;
  box-sizing: border-box;
}

.cert-lb-paper-frame img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2px;
  user-select: none;
  -webkit-user-drag: none;
}

.cert-lb-sidebar {
  border-left: 1px solid var(--border-gold-dim);
  padding: 22px;
  overflow-y: auto;
  background: var(--bg-elevated);
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  box-sizing: border-box;
}

.cert-lb-thumbs {
  grid-column: 1 / -1;
  border-top: 1px solid var(--border-gold-dim);
  background: var(--bg-obsidian);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  min-width: 0;
  box-sizing: border-box;
}

.cert-thumb-item {
  flex: 0 0 auto;
  width: 52px;
  height: 64px;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.14);
  cursor: pointer;
  opacity: 0.55;
  transition: all 0.2s ease;
  position: relative;
  background: #fff;
}

.cert-thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.cert-thumb-item.active,
.cert-thumb-item:hover {
  opacity: 1;
  border-color: var(--gold-300);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(216, 164, 68, 0.45);
}

/* Toast Notification */
.ig-toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 10005;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.ig-toast {
  background: #17140E;
  border: 1.5px solid #E8B85C;
  color: #FFFFFF;
  padding: 12px 16px;
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.36);
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 13.5px;
  pointer-events: auto;
  animation: toastSlideIn 0.22s cubic-bezier(0.2, 0.9, 0.2, 1);
  max-width: 380px;
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 920px) {
  .ig-toast-container {
    top: calc(env(safe-area-inset-top, 0px) + 56px);
    left: 14px;
    right: 14px;
    align-items: center;
  }
  .ig-toast {
    width: 100%;
    max-width: 390px;
    padding: 11px 14px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
  }
}

/* Custom Scrollbar (Standard + Legacy WebKit Fallback) */
@supports not (scrollbar-color: auto) {
  ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }
  ::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
  }
  ::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 99px;
  }
  ::-webkit-scrollbar-thumb:hover {
    background: var(--gold-400);
  }
}

@media (max-width: 920px) {
  dialog.ig-dialog.cert-lightbox-backdrop {
    padding: 0;
    width: 100vw;
    height: 100dvh;
    max-width: 100vw;
    max-height: 100dvh;
    overflow: hidden;
  }
  dialog.ig-dialog.cert-lightbox-backdrop[open] {
    display: block;
  }
  .cert-lightbox-shell {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: none;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto auto;
  }
  .cert-lb-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px;
  }
  .cert-lb-head-main {
    justify-content: space-between;
    width: 100%;
    gap: 8px;
  }
  .cert-lb-badge {
    display: block;
    font-size: 10.5px;
    padding: 3px 8px;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .cert-lb-mobile-close {
    display: inline-flex;
  }
  .cert-lb-desktop-close {
    display: none;
  }
  .cert-lb-info-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .cert-lb-head-controls {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    flex-wrap: nowrap;
  }
  .cert-lb-ctrl-btn {
    padding: 6px 8px;
    font-size: 11.5px;
    flex: 1 1 auto;
    min-width: 0;
    text-align: center;
  }
  #certLbZoomLabel {
    min-width: 38px !important;
    font-size: 11.5px !important;
    flex: 0 0 auto;
  }
  .cert-lb-stage {
    padding: 12px;
    align-items: flex-start;
    justify-content: safe center;
  }
  .cert-lb-paper-frame {
    padding: 6px;
    border-radius: 4px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.78), 0 0 0 1px rgba(218, 165, 69, 0.5);
  }
  .cert-lb-sidebar {
    border-left: none;
    border-top: 1px solid var(--border-gold-dim);
    padding: 10px 14px;
    gap: 10px;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
    border-top-width: 0;
    transition: max-height 0.24s ease, padding 0.24s ease;
  }
  .cert-lightbox-shell.mobile-info-open .cert-lb-sidebar {
    max-height: 36dvh;
    padding: 12px 14px;
    border-top-width: 1px;
    overflow-y: auto;
  }
  .cert-lb-thumbs {
    padding: 8px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    gap: 8px;
  }
  .cert-thumb-item {
    width: 42px;
    height: 54px;
  }
}

/* Scoped Dark Surface Lock for Photography Banners & Globes */
.ig-dark-surface {
  color-scheme: dark;
  --text-strong: #FFFFFF;
  --text-primary: #F5F2EB;
  --text-body: #E5E2DA;
  --text-soft: #C9C3B5;
  --text-secondary: #A9A69E;
  --text-muted: #7D7A72;
  --gold-100: #FFF3CE;
  --gold-200: #FCE29B;
  --gold-300: #F0C66D;
  --surface-soft: rgba(255, 255, 255, 0.05);
  --surface-hover: rgba(255, 255, 255, 0.10);
  --border-control: rgba(255, 255, 255, 0.16);
  --border-subtle: rgba(255, 255, 255, 0.08);
}

/* Seconds Contract Countdown & Settlement Result Modal (Light & Dark Adaptive) */
dialog.ig-dialog.ig-sec-modal-backdrop {
  margin: auto;
  padding: 16px;
  background: transparent;
}
dialog.ig-dialog.ig-sec-modal-backdrop::backdrop {
  background: rgba(5, 6, 9, 0.72);
  backdrop-filter: blur(8px);
}
.ig-sec-modal-card {
  width: min(92vw, 356px);
  background: linear-gradient(165deg, var(--bg-dialog-top) 0%, var(--bg-dialog-bot) 100%);
  border: 1px solid var(--border-gold-mid);
  border-radius: 20px;
  box-shadow: var(--shadow-modal);
  padding: 18px 20px 20px;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
.ig-sec-modal-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 14px;
}
.ig-sec-modal-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-strong);
  letter-spacing: 0.2px;
}
.ig-sec-modal-close {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border-control);
  background: var(--surface-soft);
  color: var(--text-secondary);
  font-size: 17px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.ig-sec-ring-wrap {
  position: relative;
  width: 136px;
  height: 136px;
  margin: 4px 0 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ig-sec-ring-svg {
  width: 136px;
  height: 136px;
  transform: rotate(-90deg);
}
.ig-sec-ring-track {
  fill: none;
  stroke: var(--border-control);
  stroke-width: 7;
}
.ig-sec-ring-prog {
  fill: none;
  stroke: var(--gold-400);
  stroke-width: 7;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.35s linear;
}
.ig-sec-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px;
}
.ig-sec-count-num {
  font-size: 36px;
  font-weight: 800;
  line-height: 1.05;
  color: var(--gold-300);
}
.ig-sec-count-sub {
  margin-top: 5px;
  font-size: 14px;
  font-weight: 700;
  color: var(--down-bright);
}
.ig-sec-grid4 {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  text-align: center;
  padding: 12px 4px 16px;
  border-top: 1px solid var(--border-subtle);
}
.ig-sec-glabel {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 5px;
  white-space: nowrap;
}
.ig-sec-gval {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-strong);
  word-break: break-word;
}
.ig-sec-result-hero {
  width: 100%;
  text-align: center;
  padding: 10px 4px 16px;
}
.ig-sec-result-pnl {
  font-size: 34px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.ig-sec-result-sub {
  margin-top: 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-body);
}
.ig-sec-summary-box {
  width: 100%;
  background: var(--surface-soft);
  border: 1px solid var(--border-subtle);
  border-radius: 13px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 16px;
}
.ig-sec-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
}
.ig-sec-summary-row > span:first-child {
  color: var(--text-secondary);
}
.ig-sec-summary-row > span:last-child {
  font-weight: 700;
}


/* Password Visibility Toggle Wrapper */
.ig-pwd-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.ig-pwd-wrap > .lux-input,
.ig-pwd-wrap > input {
  width: 100%;
  padding-right: 40px !important;
}
.ig-pwd-eye {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 8px;
  padding: 0;
  transition: color 0.18s ease, background 0.18s ease;
}
.ig-pwd-eye:hover,
.ig-pwd-eye[aria-pressed="true"] {
  color: var(--gold-300);
  background: rgba(218, 165, 69, 0.12);
}

/* Withdraw Available Balance Banner */
.ig-cashier-avail-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(218, 165, 69, 0.10);
  border: 1px solid rgba(218, 165, 69, 0.30);
  font-size: 12px;
  margin-bottom: 8px;
}

/* Countdown Payout Ratio Sub-pill */
.ig-sec-ratio-note {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-secondary);
  padding: 6px 10px;
  border-radius: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--border-subtle);
}

/* Settled Receipt Modal v2 (Matches Reference Figure 6) */
.ig-settle-v2-card {
  width: 100%;
  display: flex;
  flex-direction: column;
}
.ig-settle-v2-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}
.ig-settle-v2-sym {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.ig-settle-v2-title {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--text-strong);
  line-height: 1.2;
}
.ig-settle-v2-ref {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 2px;
  letter-spacing: 0.2px;
}
.ig-settle-side-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.ig-settle-side-pill.is-buy {
  background: rgba(13, 158, 97, 0.13);
  color: var(--up-bright);
}
.ig-settle-side-pill.is-sell {
  background: rgba(229, 72, 77, 0.13);
  color: var(--down-bright);
}
.ig-settle-v2-hero {
  text-align: center;
  padding: 16px 4px 12px;
}
.ig-settle-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
}
.ig-settle-status-pill.is-win {
  background: rgba(13, 158, 97, 0.14);
  color: var(--up-bright);
}
.ig-settle-status-pill.is-loss {
  background: rgba(229, 72, 77, 0.14);
  color: var(--down-bright);
}
.ig-settle-v2-amount {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.ig-settle-v2-sub {
  margin-top: 5px;
  font-size: 12px;
  color: var(--text-muted);
}
.ig-settle-v2-rows {
  width: 100%;
  border-top: 1px solid var(--border-subtle);
  margin-top: 6px;
  margin-bottom: 10px;
}
.ig-settle-v2-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 2px;
  border-bottom: 1px solid var(--border-row);
  font-size: 12.5px;
}
.ig-settle-v2-row > span:first-child {
  color: var(--text-muted);
  white-space: nowrap;
}
.ig-settle-v2-row > span:last-child {
  font-weight: 700;
  color: var(--text-strong);
  text-align: right;
}
.ig-settle-v2-foot {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
