
/* =========================================================
   IMR BRAND THEME — LIGHT / DARK
   Brand palette: #A97922 #DDB45F #211D12 #756B58 #9B9488
   Backgrounds: #F4F0E8 #FFFFFF
   Status: #16B364 #E5484D #F5A524 #7B8794
   ========================================================= */
:root {
  --imr-primary:#A97922;
  --imr-reach:#DDB45F;
  --imr-navy:#211D12;
  --imr-text-soft:#756B58;
  --imr-muted:#9B9488;
  --imr-bg:#F4F0E8;
  --imr-surface:#FFFFFF;
  --imr-surface-2:#F8FBFF;
  --imr-border:#E8DFC9;
  --imr-green:#16B364;
  --imr-red:#E5484D;
  --imr-yellow:#F5A524;
  --imr-neutral:#7B8794;
}

html[data-theme="light"] body,
html[data-theme="light"] .page,
html[data-theme="light"] .main,
html[data-theme="light"] .dashboard-shell {
  background:var(--imr-bg) !important;
  color:var(--imr-navy) !important;
}

html[data-theme="dark"] {
  --imr-bg:#211D12;
  --imr-surface:#211D12;
  --imr-surface-2:#292315;
  --imr-border:rgba(255,255,255,.10);
  --imr-text:#F4F0E8;
  --imr-text-soft:#BDB5A7;
  --imr-muted:#948B7D;
}
html[data-theme="dark"] body,
html[data-theme="dark"] .page,
html[data-theme="dark"] .main,
html[data-theme="dark"] .dashboard-shell {
  background:var(--imr-bg) !important;
  color:#F4F0E8 !important;
}

/* Theme control */
.imr-theme-toggle {
  position:fixed !important;
  right:22px !important;
  bottom:22px !important;
  z-index:10000 !important;
  width:42px !important;
  height:42px !important;
  border:1px solid rgba(169,121,34,.18) !important;
  border-radius:50% !important;
  background:#FFFFFF !important;
  color:#A97922 !important;
  box-shadow:0 8px 25px rgba(169,121,34,.15) !important;
  font-size:17px !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  cursor:pointer !important;
  transition:.2s ease !important;
}
.imr-theme-toggle:hover { transform:translateY(-2px); box-shadow:0 12px 30px rgba(169,121,34,.22) !important; }
html[data-theme="dark"] .imr-theme-toggle { background:#211D12 !important; color:#DDB45F !important; border-color:rgba(221,180,95,.28) !important; }

/* Common text / surfaces */
html[data-theme="light"] h1, html[data-theme="light"] h2, html[data-theme="light"] h3, html[data-theme="light"] h4,
html[data-theme="light"] .title, html[data-theme="light"] .heading,
html[data-theme="light"] .logo-title, html[data-theme="light"] .nav-logo { color:var(--imr-navy) !important; }
html[data-theme="dark"] h1, html[data-theme="dark"] h2, html[data-theme="dark"] h3, html[data-theme="dark"] h4,
html[data-theme="dark"] .title, html[data-theme="dark"] .heading,
html[data-theme="dark"] .logo-title, html[data-theme="dark"] .nav-logo { color:#F4F0E8 !important; }

html[data-theme="light"] p, html[data-theme="light"] .description, html[data-theme="light"] .subtitle,
html[data-theme="light"] .header-description, html[data-theme="light"] .section-description { color:var(--imr-text-soft) !important; }
html[data-theme="dark"] p, html[data-theme="dark"] .description, html[data-theme="dark"] .subtitle,
html[data-theme="dark"] .header-description, html[data-theme="dark"] .section-description { color:#BDB5A7 !important; }

html[data-theme="light"] .card, html[data-theme="light"] .imr-card, html[data-theme="light"] .dashboard-card,
html[data-theme="light"] .expert-dashboard-card, html[data-theme="light"] .analysis-card,
html[data-theme="light"] .record-wrapper, html[data-theme="light"] .expert-stat,
html[data-theme="light"] .decision-main, html[data-theme="light"] .confidence-box,
html[data-theme="light"] .level { background:#FFFFFF !important; color:var(--imr-navy) !important; border-color:var(--imr-border) !important; }
html[data-theme="dark"] .card, html[data-theme="dark"] .imr-card, html[data-theme="dark"] .dashboard-card,
html[data-theme="dark"] .expert-dashboard-card, html[data-theme="dark"] .analysis-card,
html[data-theme="dark"] .record-wrapper, html[data-theme="dark"] .expert-stat,
html[data-theme="dark"] .decision-main, html[data-theme="dark"] .confidence-box,
html[data-theme="dark"] .level { background:var(--imr-surface) !important; color:#F4F0E8 !important; border-color:var(--imr-border) !important; }

html[data-theme="light"] .sidebar { background:#FFFFFF !important; border-color:var(--imr-border) !important; }
html[data-theme="dark"] .sidebar { background:#0B0D11 !important; border-color:rgba(255,255,255,.08) !important; }
html[data-theme="dark"] .nav-item { color:#948B7D !important; }
html[data-theme="light"] .nav-item { color:var(--imr-muted) !important; }
html[data-theme="light"] .nav-item.active { background:rgba(221,180,95,.08) !important; color:var(--imr-primary) !important; }
html[data-theme="dark"] .nav-item.active { background:rgba(221,180,95,.13) !important; color:#DDB45F !important; }

/* Links / actions */
html[data-theme="light"] a { color:inherit; }
html[data-theme="dark"] a { color:inherit; }
html[data-theme="light"] .btn-primary, html[data-theme="light"] .button.primary, html[data-theme="light"] .cta-button { background:#DDB45F !important; color:#FFFFFF !important; border-color:#DDB45F !important; }
html[data-theme="dark"] .btn-primary, html[data-theme="dark"] .button.primary, html[data-theme="dark"] .cta-button { background:#DDB45F !important; color:#FFFFFF !important; border-color:#DDB45F !important; }
html[data-theme="light"] .btn-secondary, html[data-theme="light"] .button.secondary { background:#FFFFFF !important; color:#A97922 !important; border-color:#D9CBAF !important; }
html[data-theme="dark"] .btn-secondary, html[data-theme="dark"] .button.secondary { background:transparent !important; color:#F4F0E8 !important; border-color:rgba(255,255,255,.20) !important; }

/* Forms */
html[data-theme="light"] input, html[data-theme="light"] select, html[data-theme="light"] textarea {
  background:#FFFFFF !important; color:#211D12 !important; border-color:#C8D6E5 !important;
}
html[data-theme="dark"] input, html[data-theme="dark"] select, html[data-theme="dark"] textarea {
  background:#14130F !important; color:#F4F0E8 !important; border-color:rgba(255,255,255,.14) !important;
}
html[data-theme="light"] input::placeholder, html[data-theme="light"] textarea::placeholder { color:#9B9488 !important; }
html[data-theme="dark"] input::placeholder, html[data-theme="dark"] textarea::placeholder { color:#948B7D !important; }
html[data-theme="light"] label { color:#756B58 !important; }
html[data-theme="dark"] label { color:#BDB5A7 !important; }

/* Tables */
html[data-theme="light"] th { color:#756B58 !important; background:#F4F0E8 !important; border-color:var(--imr-border) !important; }
html[data-theme="light"] td { color:#211D12 !important; border-color:var(--imr-border) !important; }
html[data-theme="dark"] th { color:#948B7D !important; background:#292315 !important; border-color:var(--imr-border) !important; }
html[data-theme="dark"] td { color:#E7EEF7 !important; border-color:var(--imr-border) !important; }

/* Status */
.status-buy,.decision.buy { color:#16B364 !important; }
.status-sell,.decision.sell { color:#E5484D !important; }
.status-wait { color:#F5A524 !important; }

/* Home page: make the existing hero use the actual IMR palette */
html[data-theme="light"] .navbar { background:rgba(255,255,255,.92) !important; border-bottom:1px solid rgba(169,121,34,.08) !important; }
html[data-theme="dark"] .navbar { background:rgba(7,26,56,.92) !important; border-bottom:1px solid rgba(255,255,255,.08) !important; }
html[data-theme="light"] .nav-link, html[data-theme="light"] .nav-login { color:#756B58 !important; }
html[data-theme="dark"] .nav-link, html[data-theme="dark"] .nav-login { color:#A9BAD0 !important; }
html[data-theme="light"] .nav-link:hover, html[data-theme="light"] .nav-login:hover { color:#A97922 !important; }
html[data-theme="dark"] .nav-link:hover, html[data-theme="dark"] .nav-login:hover { color:#DDB45F !important; }
html[data-theme="light"] .hero-section, html[data-theme="light"] .hero { background:transparent !important; }
html[data-theme="dark"] .hero-section, html[data-theme="dark"] .hero { background:transparent !important; }
html[data-theme="light"] .hero-label, html[data-theme="light"] .section-label { color:#A97922 !important; }
html[data-theme="dark"] .hero-label, html[data-theme="dark"] .section-label { color:#DDB45F !important; }
html[data-theme="light"] .headline, html[data-theme="light"] .section-title { color:#211D12 !important; }
html[data-theme="dark"] .headline, html[data-theme="dark"] .section-title { color:#F4F0E8 !important; }
html[data-theme="light"] .description { color:#756B58 !important; }
html[data-theme="dark"] .description { color:#BDB5A7 !important; }
html[data-theme="light"] .hero-meta { color:#7B8794 !important; }
html[data-theme="dark"] .hero-meta { color:#948B7D !important; }
html[data-theme="light"] .analysis-card { background:linear-gradient(145deg,#FFFFFF,#F4F0E8) !important; box-shadow:0 25px 80px rgba(169,121,34,.15) !important; }
html[data-theme="dark"] .analysis-card { background:linear-gradient(145deg,#211D12,#211D12) !important; box-shadow:0 25px 80px rgba(0,0,0,.35) !important; }
html[data-theme="light"] .preview-label, html[data-theme="light"] .preview-footer { border-color:#E8DFC9 !important; }
html[data-theme="dark"] .preview-label, html[data-theme="dark"] .preview-footer { border-color:rgba(255,255,255,.10) !important; }
html[data-theme="light"] .preview-label-left, html[data-theme="light"] .timeframe, html[data-theme="light"] .market-name { color:#7B8794 !important; }
html[data-theme="dark"] .preview-label-left, html[data-theme="dark"] .timeframe, html[data-theme="dark"] .market-name { color:#948B7D !important; }
html[data-theme="light"] .market-symbol { color:#211D12 !important; }
html[data-theme="dark"] .market-symbol { color:#F4F0E8 !important; }
html[data-theme="light"] .small-label { color:#756B58 !important; }
html[data-theme="dark"] .small-label { color:#948B7D !important; }
html[data-theme="light"] .level-value { color:#211D12 !important; }
html[data-theme="dark"] .level-value { color:#E7EEF7 !important; }
html[data-theme="light"] .expert-section { border-color:#E8DFC9 !important; }
html[data-theme="dark"] .expert-section { border-color:rgba(255,255,255,.10) !important; }

/* Bright brand accents */
.eyebrow, .section-label { color:#DDB45F !important; }

@media (max-width:700px){
  .imr-theme-toggle { right:14px !important; bottom:14px !important; }
}

/* =========================================================
   IMR BRAND REFRESH v2
   Stronger light-mode contrast + complete dark-mode coverage
   ========================================================= */

:root {
  --imr-light-bg: #FFFFFF;
  --imr-light-surface: #FFFFFF;
  --imr-light-surface-2: #FBF8F0;
  --imr-light-border: #D9CBAF;
  --imr-light-text: #211D12;
  --imr-light-soft: #3F526B;
  --imr-light-muted: #687B91;
}

html[data-theme="light"] {
  color-scheme: light;
  --imr-bg: #FFFFFF;
  --imr-surface: #FFFFFF;
  --imr-surface-2: #FBF8F0;
  --imr-border: #D9CBAF;
  --imr-text: #211D12;
  --imr-text-soft: #3F526B;
  --imr-muted: #687B91;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --imr-bg: #211D12;
  --imr-surface: #211D12;
  --imr-surface-2: #292315;
  --imr-border: rgba(143, 178, 214, 0.20);
  --imr-text: #F4F0E8;
  --imr-text-soft: #C0D0E2;
  --imr-muted: #91A8C1;
}

/* Typography: slightly larger and higher contrast */
html[data-theme="light"] body,
html[data-theme="dark"] body {
  font-size: 15px !important;
  line-height: 1.65 !important;
}

html[data-theme="light"] h1,
html[data-theme="light"] h2,
html[data-theme="light"] h3,
html[data-theme="light"] h4,
html[data-theme="light"] .title,
html[data-theme="light"] .heading,
html[data-theme="light"] .section-title,
html[data-theme="light"] .headline {
  color: #211D12 !important;
}

html[data-theme="light"] p,
html[data-theme="light"] .description,
html[data-theme="light"] .subtitle,
html[data-theme="light"] .header-description,
html[data-theme="light"] .section-description,
html[data-theme="light"] .card-description {
  color: #3F526B !important;
}

html[data-theme="light"] .text,
html[data-theme="light"] .value,
html[data-theme="light"] .card-value,
html[data-theme="light"] .data-value,
html[data-theme="light"] .result-level-value,
html[data-theme="light"] .intelligence-value,
html[data-theme="light"] .expert-position-value {
  color: #211D12 !important;
}

html[data-theme="light"] .label,
html[data-theme="light"] .card-label,
html[data-theme="light"] .data-label,
html[data-theme="light"] .result-level-label,
html[data-theme="light"] .intelligence-label,
html[data-theme="light"] .expert-position-label {
  color: #566B82 !important;
}

/* Complete surface map for the client cabinet */
html[data-theme="light"] .dashboard-shell,
html[data-theme="light"] .main-content,
html[data-theme="light"] .page,
html[data-theme="light"] .main {
  background: #FFFFFF !important;
}

html[data-theme="dark"] .dashboard-shell,
html[data-theme="dark"] .main-content,
html[data-theme="dark"] .page,
html[data-theme="dark"] .main {
  background: #211D12 !important;
}

html[data-theme="light"] .sidebar {
  background: #FFFFFF !important;
  border-right-color: #D9CBAF !important;
}

html[data-theme="dark"] .sidebar {
  background: #06172F !important;
  border-right-color: rgba(185,137,50,.18) !important;
}

html[data-theme="light"] .dashboard-card,
html[data-theme="light"] .imr-card,
html[data-theme="light"] .market-card,
html[data-theme="light"] .pair-card,
html[data-theme="light"] .timeframe-card,
html[data-theme="light"] .result-level-card,
html[data-theme="light"] .intelligence-card,
html[data-theme="light"] .result-info-card,
html[data-theme="light"] .expert-dashboard-card,
html[data-theme="light"] .expert-position-item,
html[data-theme="light"] .expert-no-position,
html[data-theme="light"] .expert-stat,
html[data-theme="light"] .expert-stat-card,
html[data-theme="light"] .record-wrapper,
html[data-theme="light"] .analysis-card,
html[data-theme="light"] .decision-main,
html[data-theme="light"] .confidence-box,
html[data-theme="light"] .level {
  background: #FFFFFF !important;
  color: #211D12 !important;
  border-color: #D9CBAF !important;
}

html[data-theme="dark"] .dashboard-card,
html[data-theme="dark"] .imr-card,
html[data-theme="dark"] .market-card,
html[data-theme="dark"] .pair-card,
html[data-theme="dark"] .timeframe-card,
html[data-theme="dark"] .result-level-card,
html[data-theme="dark"] .intelligence-card,
html[data-theme="dark"] .result-info-card,
html[data-theme="dark"] .expert-dashboard-card,
html[data-theme="dark"] .expert-position-item,
html[data-theme="dark"] .expert-no-position,
html[data-theme="dark"] .expert-stat,
html[data-theme="dark"] .expert-stat-card,
html[data-theme="dark"] .record-wrapper,
html[data-theme="dark"] .analysis-card,
html[data-theme="dark"] .decision-main,
html[data-theme="dark"] .confidence-box,
html[data-theme="dark"] .level {
  background: #211D12 !important;
  color: #F4F0E8 !important;
  border-color: rgba(185,137,50,.20) !important;
}

/* Dark mode: remove leftover white hero/surface blocks */
html[data-theme="dark"] .analysis-hero,
html[data-theme="dark"] .market-intro-card,
html[data-theme="dark"] .result-hero {
  background:
    radial-gradient(circle at 82% 50%, rgba(221,180,95,.14), transparent 31%),
    linear-gradient(135deg, #211D12, #211D12) !important;
  border-color: rgba(185,137,50,.20) !important;
  box-shadow: 0 18px 50px rgba(0,0,0,.28) !important;
}

html[data-theme="dark"] .analysis-hero h2,
html[data-theme="dark"] .market-intro-content h2,
html[data-theme="dark"] .result-summary strong,
html[data-theme="dark"] .confidence-value,
html[data-theme="dark"] .result-level-value {
  color: #F4F0E8 !important;
}

html[data-theme="dark"] .analysis-hero p,
html[data-theme="dark"] .market-intro-content p,
html[data-theme="dark"] .result-summary {
  color: #C0D0E2 !important;
}

html[data-theme="dark"] .market-card-content h3,
html[data-theme="dark"] .pair-name,
html[data-theme="dark"] .timeframe-name,
html[data-theme="dark"] .intelligence-value,
html[data-theme="dark"] .expert-position-value,
html[data-theme="dark"] .card-value {
  color: #F4F0E8 !important;
}

html[data-theme="dark"] .market-card-content p,
html[data-theme="dark"] .pair-description,
html[data-theme="dark"] .timeframe-description,
html[data-theme="dark"] .result-level-sub,
html[data-theme="dark"] .intelligence-sub,
html[data-theme="dark"] .expert-status,
html[data-theme="dark"] .expert-no-position-title,
html[data-theme="dark"] .expert-no-position-text {
  color: #AFC1D6 !important;
}

/* Expert dashboard: eliminate hard-coded white blocks */
html[data-theme="dark"] .expert-dashboard-card,
html[data-theme="dark"] .expert-position-item,
html[data-theme="dark"] .expert-no-position {
  background: #211D12 !important;
  border-color: rgba(185,137,50,.20) !important;
}

html[data-theme="dark"] .expert-position-label {
  color: #91A8C1 !important;
}

html[data-theme="dark"] .expert-position-value {
  color: #F4F0E8 !important;
}

/* Home navigation: visible controls in BOTH themes */
html[data-theme="light"] .nav-logo,
html[data-theme="light"] .nav-link,
html[data-theme="light"] .nav-login {
  color: #211D12 !important;
}

html[data-theme="dark"] .nav-logo,
html[data-theme="dark"] .nav-link,
html[data-theme="dark"] .nav-login {
  color: #F4F0E8 !important;
}

html[data-theme="light"] .nav-link:hover,
html[data-theme="light"] .nav-login:hover,
html[data-theme="dark"] .nav-link:hover,
html[data-theme="dark"] .nav-login:hover {
  color: #DDB45F !important;
}

html[data-theme="light"] .nav-start,
html[data-theme="dark"] .nav-start {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 42px !important;
  padding: 0 18px !important;
  border: 1px solid #DDB45F !important;
  border-radius: 8px !important;
  background: #DDB45F !important;
  color: #FFFFFF !important;
  font-size: 12px !important;
}

html[data-theme="light"] .nav-login {
  display: inline-flex !important;
  align-items: center !important;
  min-height: 42px !important;
  padding: 0 15px !important;
  border: 1px solid #D9CBAF !important;
  border-radius: 8px !important;
  background: #FFFFFF !important;
  color: #211D12 !important;
}

html[data-theme="dark"] .nav-login {
  display: inline-flex !important;
  align-items: center !important;
  min-height: 42px !important;
  padding: 0 15px !important;
  border: 1px solid rgba(221,180,95,.38) !important;
  border-radius: 8px !important;
  background: rgba(221,180,95,.08) !important;
  color: #F4F0E8 !important;
}

html[data-theme="light"] .nav-start:hover,
html[data-theme="dark"] .nav-start:hover {
  background: #A97922 !important;
  border-color: #A97922 !important;
  color: #FFFFFF !important;
}

/* Homepage expert CTA: no white-on-white text */
html[data-theme="light"] .expert-cta {
  background: #FFFFFF !important;
  border-color: #D9CBAF !important;
}
html[data-theme="dark"] .expert-cta {
  background: #211D12 !important;
  border-color: rgba(185,137,50,.20) !important;
}
html[data-theme="light"] .cta-title,
html[data-theme="light"] .cta-text {
  color: #211D12 !important;
}
html[data-theme="dark"] .cta-title {
  color: #F4F0E8 !important;
}
html[data-theme="dark"] .cta-text {
  color: #C0D0E2 !important;
}
html[data-theme="light"] .cta-button,
html[data-theme="dark"] .cta-button {
  background: #DDB45F !important;
  border: 1px solid #DDB45F !important;
  color: #FFFFFF !important;
}
html[data-theme="light"] .cta-button:hover,
html[data-theme="dark"] .cta-button:hover {
  background: #A97922 !important;
  border-color: #A97922 !important;
}

/* Buy Credits / packages — replace legacy black/white styling */
html[data-theme="light"] .package,
html[data-theme="light"] .credit-card,
html[data-theme="light"] .balance-card {
  background: #FFFFFF !important;
  color: #211D12 !important;
  border-color: #D9CBAF !important;
}
html[data-theme="dark"] .package,
html[data-theme="dark"] .credit-card,
html[data-theme="dark"] .balance-card {
  background: #211D12 !important;
  color: #F4F0E8 !important;
  border-color: rgba(185,137,50,.20) !important;
}
html[data-theme="light"] .package-name,
html[data-theme="light"] .credits-number,
html[data-theme="light"] .price {
  color: #211D12 !important;
}
html[data-theme="dark"] .package-name,
html[data-theme="dark"] .credits-number,
html[data-theme="dark"] .price {
  color: #F4F0E8 !important;
}
html[data-theme="light"] .credits-label,
html[data-theme="light"] .back a,
html[data-theme="light"] .header p {
  color: #566B82 !important;
}
html[data-theme="dark"] .credits-label,
html[data-theme="dark"] .back a,
html[data-theme="dark"] .header p {
  color: #AFC1D6 !important;
}
html[data-theme="light"] .select-button,
html[data-theme="dark"] .select-button {
  background: #DDB45F !important;
  color: #FFFFFF !important;
  border: 1px solid #DDB45F !important;
}
html[data-theme="light"] .select-button:hover,
html[data-theme="dark"] .select-button:hover {
  background: #A97922 !important;
  color: #FFFFFF !important;
}

/* Legacy standalone credit page */
html[data-theme="light"] .navbar,
html[data-theme="dark"] .navbar {
  background: var(--imr-surface) !important;
  border-bottom-color: var(--imr-border) !important;
}
html[data-theme="light"] .logo,
html[data-theme="light"] .header h1,
html[data-theme="light"] .package-name,
html[data-theme="light"] .credits-number,
html[data-theme="light"] .price {
  color: #211D12 !important;
}
html[data-theme="dark"] .logo,
html[data-theme="dark"] .header h1,
html[data-theme="dark"] .package-name,
html[data-theme="dark"] .credits-number,
html[data-theme="dark"] .price {
  color: #F4F0E8 !important;
}

/* Login / register legacy forms */
html[data-theme="light"] .button,
html[data-theme="dark"] .button {
  background: #DDB45F !important;
  border-color: #DDB45F !important;
  color: #FFFFFF !important;
}
html[data-theme="light"] .button:hover,
html[data-theme="dark"] .button:hover {
  background: #A97922 !important;
  border-color: #A97922 !important;
}
html[data-theme="light"] .login-link,
html[data-theme="light"] .back,
html[data-theme="light"] .register,
html[data-theme="light"] .help,
html[data-theme="light"] .notice {
  color: #566B82 !important;
}
html[data-theme="dark"] .login-link,
html[data-theme="dark"] .back,
html[data-theme="dark"] .register,
html[data-theme="dark"] .help,
html[data-theme="dark"] .notice {
  color: #BDB5A7 !important;
}

/* Tables, rows and history */
html[data-theme="dark"] table,
html[data-theme="dark"] .history-data-item,
html[data-theme="dark"] .data-item,
html[data-theme="dark"] .result-info-row {
  background: #211D12 !important;
  color: #F4F0E8 !important;
  border-color: rgba(185,137,50,.18) !important;
}
html[data-theme="dark"] .history-data-label,
html[data-theme="dark"] .result-info-label,
html[data-theme="dark"] .data-label {
  color: #91A8C1 !important;
}
html[data-theme="dark"] .history-data-value,
html[data-theme="dark"] .result-info-value,
html[data-theme="dark"] .data-value {
  color: #F4F0E8 !important;
}

/* Stronger light-mode borders and card separation */
html[data-theme="light"] .dashboard-card,
html[data-theme="light"] .market-card,
html[data-theme="light"] .pair-card,
html[data-theme="light"] .timeframe-card,
html[data-theme="light"] .result-level-card,
html[data-theme="light"] .intelligence-card,
html[data-theme="light"] .expert-dashboard-card {
  box-shadow: 0 8px 28px rgba(169,121,34,.06) !important;
}

/* Inputs/buttons: readable in both themes */
html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea {
  color: #211D12 !important;
  background: #FFFFFF !important;
  border-color: #D9CBAF !important;
}
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  color: #F4F0E8 !important;
  background: #14130F !important;
  border-color: rgba(185,137,50,.22) !important;
}

/* Theme toggle */
html[data-theme="light"] .imr-theme-toggle {
  background: #FFFFFF !important;
  color: #A97922 !important;
  border-color: #D9CBAF !important;
}
html[data-theme="dark"] .imr-theme-toggle {
  background: #211D12 !important;
  color: #DDB45F !important;
  border-color: rgba(221,180,95,.40) !important;
}

/* =========================================================
   IMR BRAND REFRESH v3
   Final cleanup: Expert performance + Analysis History
   ========================================================= */

/* Keep legacy IMR variables synchronized with the active theme.
   Several older components use these variables directly. */
html[data-theme="light"] {
  --imr-card: #FFFFFF;
  --imr-card-hover: #FBF8F0;
  --imr-text: #211D12;
  --imr-text-soft: #3F526B;
  --imr-text-muted: #687B91;
  --imr-cyan: #DDB45F;
  --imr-gray: #7B8794;
  --imr-border: #D9CBAF;
  --imr-bg: #FFFFFF;
}

html[data-theme="dark"] {
  --imr-card: #211D12;
  --imr-card-hover: #292315;
  --imr-text: #F4F0E8;
  --imr-text-soft: #C0D0E2;
  --imr-text-muted: #91A8C1;
  --imr-cyan: #DDB45F;
  --imr-gray: #948B7D;
  --imr-border: rgba(185,137,50,.20);
  --imr-bg: #211D12;
}

/* Expert performance page + homepage expert statistics */
html[data-theme="light"] .expert-stat-card {
  background: #FFFFFF !important;
  border-color: #D9CBAF !important;
  color: #211D12 !important;
}
html[data-theme="dark"] .expert-stat-card {
  background: #211D12 !important;
  border-color: rgba(185,137,50,.20) !important;
  color: #F4F0E8 !important;
}

html[data-theme="light"] .expert-stat-value,
html[data-theme="light"] .expert-stat-card .expert-stat-value {
  color: #211D12 !important;
}
html[data-theme="dark"] .expert-stat-value,
html[data-theme="dark"] .expert-stat-card .expert-stat-value {
  color: #F4F0E8 !important;
}

html[data-theme="light"] .expert-stat-label,
html[data-theme="light"] .expert-empty,
html[data-theme="light"] .expert-empty-text {
  color: #566B82 !important;
}
html[data-theme="dark"] .expert-stat-label,
html[data-theme="dark"] .expert-empty,
html[data-theme="dark"] .expert-empty-text {
  color: #AFC1D6 !important;
}

html[data-theme="light"] .expert-table-wrapper {
  background: #FFFFFF !important;
  border-color: #D9CBAF !important;
}
html[data-theme="dark"] .expert-table-wrapper {
  background: #211D12 !important;
  border-color: rgba(185,137,50,.20) !important;
}

html[data-theme="light"] .expert-table th {
  color: #566B82 !important;
  border-bottom-color: #D9CBAF !important;
  background: #FBF8F0 !important;
}
html[data-theme="dark"] .expert-table th {
  color: #91A8C1 !important;
  border-bottom-color: rgba(185,137,50,.20) !important;
  background: #292315 !important;
}

html[data-theme="light"] .expert-table td {
  color: #211D12 !important;
  border-bottom-color: #E8DFC9 !important;
}
html[data-theme="dark"] .expert-table td {
  color: #E7EEF7 !important;
  border-bottom-color: rgba(185,137,50,.16) !important;
}

html[data-theme="light"] .expert-empty-title {
  color: #211D12 !important;
}
html[data-theme="dark"] .expert-empty-title {
  color: #F4F0E8 !important;
}

/* Analysis History — remove all legacy white surfaces in dark mode */
html[data-theme="dark"] .history-card,
html[data-theme="dark"] .history-empty-card {
  background: #211D12 !important;
  color: #F4F0E8 !important;
  border-color: rgba(185,137,50,.20) !important;
  box-shadow: 0 12px 35px rgba(0,0,0,.18) !important;
}

html[data-theme="dark"] .history-card:hover {
  background: #292315 !important;
  border-color: rgba(221,180,95,.30) !important;
}

html[data-theme="dark"] .history-symbol,
html[data-theme="dark"] .history-data-value,
html[data-theme="dark"] .history-empty-card h3 {
  color: #F4F0E8 !important;
}

html[data-theme="dark"] .history-meta,
html[data-theme="dark"] .history-data-label,
html[data-theme="dark"] .history-date,
html[data-theme="dark"] .history-empty-card p {
  color: #91A8C1 !important;
}

html[data-theme="dark"] .history-separator {
  color: #5E7895 !important;
}

html[data-theme="dark"] .history-card-top,
html[data-theme="dark"] .history-card-footer,
html[data-theme="dark"] .history-data-item {
  border-color: rgba(185,137,50,.20) !important;
}

html[data-theme="dark"] .history-action {
  color: #DDB45F !important;
}

/* Light history gets the same readable brand contrast */
html[data-theme="light"] .history-card,
html[data-theme="light"] .history-empty-card {
  background: #FFFFFF !important;
  color: #211D12 !important;
  border-color: #D9CBAF !important;
}
html[data-theme="light"] .history-symbol,
html[data-theme="light"] .history-data-value,
html[data-theme="light"] .history-empty-card h3 {
  color: #211D12 !important;
}
html[data-theme="light"] .history-meta,
html[data-theme="light"] .history-data-label,
html[data-theme="light"] .history-date,
html[data-theme="light"] .history-empty-card p {
  color: #566B82 !important;
}
html[data-theme="light"] .history-separator {
  color: #9AAEC3 !important;
}
html[data-theme="light"] .history-card-top,
html[data-theme="light"] .history-card-footer,
html[data-theme="light"] .history-data-item {
  border-color: #E8DFC9 !important;
}
html[data-theme="light"] .history-action {
  color: #A97922 !important;
}


/* =========================================================
   IMR BRAND REFRESH v4
   History legacy variables + brand logo integration
   ========================================================= */

/* Legacy variables used by older client-cabinet components */
html[data-theme="light"] {
  --imr-card: #FFFFFF;
  --imr-card-hover: #FBF8F0;
  --imr-text: #211D12;
  --imr-text-muted: #687B91;
  --imr-text-soft: #3F526B;
  --imr-cyan: #DDB45F;
  --imr-gray: #7B8794;
}
html[data-theme="dark"] {
  --imr-card: #211D12;
  --imr-card-hover: #292315;
  --imr-text: #F4F0E8;
  --imr-text-muted: #91A8C1;
  --imr-text-soft: #C0D0E2;
  --imr-cyan: #DDB45F;
  --imr-gray: #948B7D;
}

/* History: force all legacy surfaces into the active theme */
html[data-theme="light"] .history-card,
html[data-theme="light"] .history-empty-card,
html[data-theme="light"] .history-data-grid,
html[data-theme="light"] .history-card-footer {
  background: #FFFFFF !important;
  color: #211D12 !important;
  border-color: #D9CBAF !important;
}
html[data-theme="dark"] .history-card,
html[data-theme="dark"] .history-empty-card,
html[data-theme="dark"] .history-data-grid,
html[data-theme="dark"] .history-card-footer {
  background: #211D12 !important;
  color: #F4F0E8 !important;
  border-color: rgba(185,137,50,.20) !important;
}
html[data-theme="dark"] .history-card:hover {
  background: #292315 !important;
}
html[data-theme="dark"] .history-symbol,
html[data-theme="dark"] .history-data-value {
  color: #F4F0E8 !important;
}
html[data-theme="dark"] .history-meta,
html[data-theme="dark"] .history-data-label,
html[data-theme="dark"] .history-date {
  color: #91A8C1 !important;
}
html[data-theme="dark"] .history-separator {
  color: #5E7898 !important;
}
html[data-theme="dark"] .history-action {
  color: #DDB45F !important;
}

/* Home demo card sits slightly lower and remains visually balanced */
@media (min-width: 901px) {
  html[data-theme="light"] .preview-wrapper,
  html[data-theme="dark"] .preview-wrapper {
    transform: translateY(28px);
  }
}

/* Public-site logo */
.imr-wordmark {
  display: block;
  width: 150px;
  height: auto;
  object-fit: contain;
}
.imr-wordmark-dark {
  display: none;
}
html[data-theme="dark"] .imr-wordmark-light {
  display: none;
}
html[data-theme="dark"] .imr-wordmark-dark {
  display: block;
}
.home-nav-logo {
  display: flex;
  align-items: center;
  min-width: 150px;
}
@media (max-width: 700px) {
  .imr-wordmark { width: 118px; }
}

/* Client-cabinet brand mark */
.sidebar-brand-logo {
  display: block;
  width: 52px;
  height: 52px;
  object-fit: contain;
  margin-bottom: 12px;
}
html[data-theme="light"] .sidebar-brand-logo {
  filter: none;
}
html[data-theme="dark"] .sidebar-brand-logo {
  filter: brightness(1.08) saturate(1.05);
}

/* Expert page inline-style cleanup */
html[data-theme="light"] .expert-stat-card,
html[data-theme="light"] .expert-table-wrapper { background:#FFFFFF !important; color:#211D12 !important; border-color:#D9CBAF !important; }
html[data-theme="dark"] .expert-stat-card,
html[data-theme="dark"] .expert-table-wrapper { background:#211D12 !important; color:#F4F0E8 !important; border-color:rgba(185,137,50,.20) !important; }
html[data-theme="light"] .expert-stat-value,
html[data-theme="light"] .expert-empty-title { color:#211D12 !important; }
html[data-theme="dark"] .expert-stat-value,
html[data-theme="dark"] .expert-empty-title { color:#F4F0E8 !important; }
html[data-theme="dark"] .expert-table th { color:#91A8C1 !important; border-color:rgba(185,137,50,.20) !important; }
html[data-theme="dark"] .expert-table td { color:#E7EEF7 !important; border-color:rgba(185,137,50,.12) !important; }


/* =========================================================
   IMR BRAND REFRESH v5
   Credits page + homepage wordmark sizing
   ========================================================= */

/* Homepage: the supplied wordmark is intentionally compact in the navbar.
   Keep the hero itself independent from the navbar logo. */
.home-nav-logo {
  width: 125px !important;
  min-width: 125px !important;
  height: 62px !important;
  display: flex !important;
  align-items: center !important;
}
.home-nav-logo .imr-wordmark {
  width: auto !important;
  height: 62px !important;
  max-width: 125px !important;
  object-fit: contain !important;
}
@media (max-width: 700px) {
  .home-nav-logo {
    width: 100px !important;
    min-width: 100px !important;
    height: 52px !important;
  }
  .home-nav-logo .imr-wordmark {
    height: 52px !important;
    max-width: 100px !important;
  }
}

/* Homepage light-mode headline hierarchy */
html[data-theme="light"] .tagline {
  color: #756B58 !important;
}
html[data-theme="dark"] .tagline {
  color: #D7E3F0 !important;
}

/* =========================================================
   CREDITS — legacy inline page, fully theme-aware
   ========================================================= */

html[data-theme="light"] .balance-card,
html[data-theme="light"] .promo-card {
  background: #FFFFFF !important;
  color: #211D12 !important;
  border-color: #D9CBAF !important;
}
html[data-theme="dark"] .balance-card,
html[data-theme="dark"] .promo-card {
  background: #211D12 !important;
  color: #F4F0E8 !important;
  border-color: rgba(185,137,50,.20) !important;
}

html[data-theme="light"] .balance,
html[data-theme="light"] .promo-title,
html[data-theme="light"] .history-title,
html[data-theme="light"] .empty-title {
  color: #211D12 !important;
}
html[data-theme="dark"] .balance,
html[data-theme="dark"] .promo-title,
html[data-theme="dark"] .history-title,
html[data-theme="dark"] .empty-title {
  color: #F4F0E8 !important;
}

html[data-theme="light"] .balance-label,
html[data-theme="light"] .balance-unit,
html[data-theme="light"] .promo-label,
html[data-theme="light"] .promo-description,
html[data-theme="light"] .history-count,
html[data-theme="light"] .transaction-reference,
html[data-theme="light"] .transaction-balance,
html[data-theme="light"] .transaction-date,
html[data-theme="light"] .empty-text,
html[data-theme="light"] .subtitle,
html[data-theme="light"] .label {
  color: #566B82 !important;
}
html[data-theme="dark"] .balance-label,
html[data-theme="dark"] .balance-unit,
html[data-theme="dark"] .promo-label,
html[data-theme="dark"] .promo-description,
html[data-theme="dark"] .history-count,
html[data-theme="dark"] .transaction-reference,
html[data-theme="dark"] .transaction-balance,
html[data-theme="dark"] .transaction-date,
html[data-theme="dark"] .empty-text,
html[data-theme="dark"] .subtitle,
html[data-theme="dark"] .label {
  color: #AFC1D6 !important;
}

html[data-theme="light"] .buy-button,
html[data-theme="light"] .promo-button {
  background: #DDB45F !important;
  color: #FFFFFF !important;
  border-color: #DDB45F !important;
}
html[data-theme="dark"] .buy-button,
html[data-theme="dark"] .promo-button {
  background: #DDB45F !important;
  color: #FFFFFF !important;
  border-color: #DDB45F !important;
}
html[data-theme="light"] .buy-button:hover,
html[data-theme="light"] .promo-button:hover,
html[data-theme="dark"] .buy-button:hover,
html[data-theme="dark"] .promo-button:hover {
  background: #A97922 !important;
  color: #FFFFFF !important;
  border-color: #A97922 !important;
}

html[data-theme="light"] .promo-input {
  background: #FFFFFF !important;
  color: #211D12 !important;
  border-color: #D9CBAF !important;
}
html[data-theme="dark"] .promo-input {
  background: #14130F !important;
  color: #F4F0E8 !important;
  border-color: rgba(185,137,50,.22) !important;
}
html[data-theme="light"] .promo-input::placeholder {
  color: #7B8794 !important;
}
html[data-theme="dark"] .promo-input::placeholder {
  color: #948B7D !important;
}

html[data-theme="light"] .transaction {
  border-color: #E8DFC9 !important;
}
html[data-theme="dark"] .transaction {
  border-color: rgba(185,137,50,.18) !important;
}
html[data-theme="light"] .transaction-type {
  color: #211D12 !important;
}
html[data-theme="dark"] .transaction-type {
  color: #F4F0E8 !important;
}
html[data-theme="light"] .transaction-amount.positive {
  color: #16B364 !important;
}
html[data-theme="dark"] .transaction-amount.positive {
  color: #16B364 !important;
}
html[data-theme="light"] .transaction-amount.negative {
  color: #E5484D !important;
}
html[data-theme="dark"] .transaction-amount.negative {
  color: #E5484D !important;
}

html[data-theme="light"] .empty {
  background: #FFFFFF !important;
  color: #211D12 !important;
  border-color: #D9CBAF !important;
}
html[data-theme="dark"] .empty {
  background: #211D12 !important;
  color: #F4F0E8 !important;
  border-color: rgba(185,137,50,.20) !important;
}

/* Credits page navigation */
html[data-theme="light"] .credits-page .navbar,
html[data-theme="dark"] .credits-page .navbar {
  background: var(--imr-surface) !important;
}


/* =========================================================
   IMR GOLD SYSTEM — SINGLE SOURCE OF TRUTH
   Dark: black / gold / white
   Light: white / gold / dark text
   ========================================================= */
:root {
  --imr-gold: #DDB45F;
  --imr-gold-light: #F0CC7C;
  --imr-gold-dark: #A97922;
  --imr-black: #090B0E;
  --imr-ink: #211D12;
  --imr-white: #FFFFFF;
  --imr-primary: var(--imr-gold-dark);
  --imr-reach: var(--imr-gold);
  --imr-cyan: var(--imr-gold);
  --imr-green: #16B364;
  --imr-red: #E5484D;
  --imr-yellow: #DDB45F;
  --imr-neutral: #948B7D;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --imr-bg: #090B0E;
  --imr-surface: #211D13;
  --imr-surface-2: #292315;
  --imr-card: #211D13;
  --imr-card-hover: #302819;
  --imr-primary: #DDB45F;
  --imr-reach: #DDB45F;
  --imr-cyan: #DDB45F;
  --imr-text: #F4F0E8;
  --imr-text-soft: #BDB5A7;
  --imr-text-muted: #948B7D;
  --imr-muted: #948B7D;
  --imr-border: rgba(221,180,95,.22);
  --imr-navy: #090B0E;
}

html[data-theme="light"] {
  color-scheme: light;
  --imr-bg: #FFFFFF;
  --imr-surface: #FFFFFF;
  --imr-surface-2: #FBF8F0;
  --imr-card: #FFFFFF;
  --imr-card-hover: #FBF8F0;
  --imr-primary: #A97922;
  --imr-reach: #B98932;
  --imr-cyan: #B98932;
  --imr-text: #211D12;
  --imr-text-soft: #756B58;
  --imr-text-muted: #948B7D;
  --imr-muted: #948B7D;
  --imr-border: rgba(169,121,34,.22);
  --imr-navy: #211D12;
}

/* Page foundations */
html[data-theme="dark"] body,
html[data-theme="dark"] .page,
html[data-theme="dark"] .main,
html[data-theme="dark"] main,
html[data-theme="dark"] .content,
html[data-theme="dark"] .content-area,
html[data-theme="dark"] .dashboard-shell,
html[data-theme="dark"] .dashboard-main,
html[data-theme="dark"] .main-content {
  background: #090B0E !important;
  color: #F4F0E8 !important;
}
html[data-theme="light"] body,
html[data-theme="light"] .page,
html[data-theme="light"] .main,
html[data-theme="light"] main,
html[data-theme="light"] .content,
html[data-theme="light"] .content-area,
html[data-theme="light"] .dashboard-shell,
html[data-theme="light"] .dashboard-main,
html[data-theme="light"] .main-content {
  background: #FFFFFF !important;
  color: #211D12 !important;
}

/* Navigation and sidebars */
html[data-theme="dark"] .navbar,
html[data-theme="dark"] header,
html[data-theme="dark"] .topbar,
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] aside {
  background: #0B0D10 !important;
  color: #F4F0E8 !important;
  border-color: rgba(221,180,95,.18) !important;
}
html[data-theme="light"] .navbar,
html[data-theme="light"] header,
html[data-theme="light"] .topbar,
html[data-theme="light"] .sidebar,
html[data-theme="light"] aside {
  background: #FFFFFF !important;
  color: #211D12 !important;
  border-color: rgba(169,121,34,.20) !important;
}
html[data-theme="dark"] .nav-link,
html[data-theme="dark"] .nav-login { color: #F4F0E8 !important; }
html[data-theme="light"] .nav-link,
html[data-theme="light"] .nav-login { color: #211D12 !important; }
html[data-theme="dark"] .nav-link:hover,
html[data-theme="dark"] .nav-login:hover,
html[data-theme="light"] .nav-link:hover,
html[data-theme="light"] .nav-login:hover { color: #DDB45F !important; }

html[data-theme="dark"] .nav-start,
html[data-theme="light"] .nav-start,
html[data-theme="dark"] .btn-primary,
html[data-theme="light"] .btn-primary,
html[data-theme="dark"] .button.primary,
html[data-theme="light"] .button.primary,
html[data-theme="dark"] .cta-button,
html[data-theme="light"] .cta-button,
html[data-theme="dark"] .select-button,
html[data-theme="light"] .select-button,
html[data-theme="dark"] .buy-button,
html[data-theme="light"] .buy-button,
html[data-theme="dark"] .promo-button,
html[data-theme="light"] .promo-button {
  background: #DDB45F !important;
  color: #211807 !important;
  border-color: #DDB45F !important;
}
html[data-theme="dark"] .nav-start:hover,
html[data-theme="light"] .nav-start:hover,
html[data-theme="dark"] .btn-primary:hover,
html[data-theme="light"] .btn-primary:hover,
html[data-theme="dark"] .button.primary:hover,
html[data-theme="light"] .button.primary:hover,
html[data-theme="dark"] .cta-button:hover,
html[data-theme="light"] .cta-button:hover,
html[data-theme="dark"] .select-button:hover,
html[data-theme="light"] .select-button:hover,
html[data-theme="dark"] .buy-button:hover,
html[data-theme="light"] .buy-button:hover,
html[data-theme="dark"] .promo-button:hover,
html[data-theme="light"] .promo-button:hover {
  background: #F0CC7C !important;
  color: #211807 !important;
  border-color: #F0CC7C !important;
}
html[data-theme="dark"] .nav-login {
  background: rgba(221,180,95,.07) !important;
  border: 1px solid rgba(221,180,95,.48) !important;
}
html[data-theme="light"] .nav-login {
  background: #FFFFFF !important;
  border: 1px solid rgba(169,121,34,.40) !important;
}

/* Cards, panels and tables */
html[data-theme="dark"] .card,
html[data-theme="dark"] [class*="card"],
html[data-theme="dark"] [class*="panel"],
html[data-theme="dark"] [class*="widget"],
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .redeem-modal,
html[data-theme="dark"] .form-container,
html[data-theme="dark"] .history-card,
html[data-theme="dark"] .history-empty-card {
  background: #211D13 !important;
  color: #F4F0E8 !important;
  border-color: rgba(221,180,95,.20) !important;
}
html[data-theme="light"] .card,
html[data-theme="light"] [class*="card"],
html[data-theme="light"] [class*="panel"],
html[data-theme="light"] [class*="widget"],
html[data-theme="light"] .modal-content,
html[data-theme="light"] .redeem-modal,
html[data-theme="light"] .form-container,
html[data-theme="light"] .history-card,
html[data-theme="light"] .history-empty-card {
  background: #FFFFFF !important;
  color: #211D12 !important;
  border-color: rgba(169,121,34,.20) !important;
}
html[data-theme="dark"] table,
html[data-theme="dark"] th,
html[data-theme="dark"] td {
  color: #F4F0E8 !important;
  border-color: rgba(221,180,95,.16) !important;
}
html[data-theme="dark"] thead th { background: #292315 !important; color: #E8C477 !important; }
html[data-theme="light"] th { background: #FBF8F0 !important; color: #756B58 !important; border-color: rgba(169,121,34,.20) !important; }
html[data-theme="light"] td { color: #211D12 !important; border-color: rgba(169,121,34,.16) !important; }

/* Typography and brand accents */
html[data-theme="dark"] h1, html[data-theme="dark"] h2,
html[data-theme="dark"] h3, html[data-theme="dark"] h4,
html[data-theme="dark"] .title, html[data-theme="dark"] .heading,
html[data-theme="dark"] .headline { color: #F4F0E8 !important; }
html[data-theme="light"] h1, html[data-theme="light"] h2,
html[data-theme="light"] h3, html[data-theme="light"] h4,
html[data-theme="light"] .title, html[data-theme="light"] .heading,
html[data-theme="light"] .headline { color: #211D12 !important; }
html[data-theme="dark"] .eyebrow,
html[data-theme="dark"] .section-label,
html[data-theme="dark"] .hero-label,
html[data-theme="dark"] .accent,
html[data-theme="dark"] .highlight,
html[data-theme="light"] .eyebrow,
html[data-theme="light"] .section-label,
html[data-theme="light"] .hero-label,
html[data-theme="light"] .accent,
html[data-theme="light"] .highlight { color: #B98932 !important; }

/* Forms and focus states */
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .form-control {
  background: #14130F !important;
  color: #F4F0E8 !important;
  border-color: rgba(221,180,95,.28) !important;
}
html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea,
html[data-theme="light"] .form-control {
  background: #FFFFFF !important;
  color: #211D12 !important;
  border-color: rgba(169,121,34,.28) !important;
}
html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus,
html[data-theme="light"] input:focus,
html[data-theme="light"] select:focus,
html[data-theme="light"] textarea:focus {
  border-color: #DDB45F !important;
  box-shadow: 0 0 0 3px rgba(221,180,95,.14) !important;
}

/* Theme toggle */
html[data-theme="dark"] .imr-theme-toggle,
html[data-theme="light"] .imr-theme-toggle {
  background: #DDB45F !important;
  color: #211807 !important;
  border-color: #DDB45F !important;
  box-shadow: 0 8px 25px rgba(169,121,34,.18) !important;
}

/* Do not recolor semantic trading states. */
.status-buy, .decision.buy, .buy { color: #16B364 !important; }
.status-sell, .decision.sell, .sell { color: #E5484D !important; }
.status-wait { color: #DDB45F !important; }


/* =========================================================
   IMR SIDEBAR TYPOGRAPHY — MATCH HOMEPAGE
   Homepage uses Arial, Helvetica, sans-serif.
   Apply the same typeface to Credits / Market News sidebars.
   ========================================================= */
html body .sidebar,
html body .sidebar *,
html body aside,
html body aside *,
html body .sidebar-nav,
html body .sidebar-nav *,
html body .nav-item,
html body .nav-item *,
html body .menu,
html body .menu * {
    font-family: Arial, Helvetica, sans-serif !important;
}


/* =========================================================
   IMR ANDROID APP DOWNLOAD — DASHBOARD + ONE-TIME PROMOTION
   ========================================================= */
html[data-theme="light"] .imr-app-download-card,
html[data-theme="dark"] .imr-app-download-card,
.imr-app-download-card {
  display:flex !important; align-items:center; gap:24px; margin:28px 0 8px; padding:25px 28px;
  border:1px solid rgba(221,180,95,.30) !important; border-radius:18px;
  background:radial-gradient(circle at 88% 50%, rgba(221,180,95,.13), transparent 34%), #211D12 !important;
  color:#F4F0E8 !important; box-shadow:0 14px 38px rgba(0,0,0,.13);
}
.imr-app-download-icon {
  flex:0 0 58px; width:58px; height:58px; display:grid; place-items:center;
  border-radius:15px; background:rgba(221,180,95,.13); color:#DDB45F; font-size:31px;
}
.imr-app-download-copy { flex:1; min-width:0; }
.imr-app-download-copy .eyebrow { color:#DDB45F !important; font-size:10px; letter-spacing:1.7px; font-weight:700; }
.imr-app-download-copy h2 { margin:7px 0 5px; color:#F4F0E8 !important; font-size:21px; }
.imr-app-download-copy p { margin:0; max-width:720px; color:#C0B8A9 !important; font-size:13px; line-height:1.6; }
.imr-app-download-meta { margin-top:12px; color:#DDB45F; font-size:9px; letter-spacing:1.2px; font-weight:700; }
.imr-app-download-meta span { padding:0 6px; opacity:.65; }
.imr-app-download-button, .imr-app-modal-download {
  display:inline-flex; align-items:center; justify-content:center; gap:14px; padding:14px 19px;
  border-radius:9px; background:#DDB45F; color:#211D12 !important; text-decoration:none !important;
  font-size:11px; font-weight:800; letter-spacing:.5px; white-space:nowrap; transition:background .2s, transform .2s;
}
.imr-app-download-button:hover, .imr-app-modal-download:hover { background:#F0CC7C; transform:translateY(-1px); }
.imr-app-modal-backdrop {
  position:fixed; inset:0; z-index:20000; display:flex; align-items:center; justify-content:center;
  padding:22px; background:rgba(5,7,10,.78); backdrop-filter:blur(7px);
}
html[data-theme="light"] .imr-app-modal,
html[data-theme="dark"] .imr-app-modal,
.imr-app-modal {
  position:relative; width:min(100%, 510px); padding:36px 34px 27px; text-align:center;
  border:1px solid rgba(221,180,95,.38) !important; border-radius:20px;
  background:radial-gradient(circle at 50% 0%, rgba(221,180,95,.13), transparent 42%), #211D12 !important;
  box-shadow:0 28px 90px rgba(0,0,0,.5); color:#F4F0E8 !important;
}
.imr-app-modal-close {
  position:absolute; top:13px; right:16px; width:34px; height:34px; border:0; border-radius:50%;
  background:rgba(255,255,255,.07); color:#E7DCC7; font-size:24px; cursor:pointer;
}
.imr-app-modal-kicker { color:#DDB45F; font-size:10px; font-weight:800; letter-spacing:2px; }
.imr-app-modal-icon {
  width:66px; height:66px; display:grid; place-items:center; margin:19px auto 16px;
  border:1px solid rgba(221,180,95,.35); border-radius:19px; background:rgba(221,180,95,.10);
  color:#DDB45F; font-size:34px;
}
.imr-app-modal h2 { margin:0 auto 10px; max-width:390px; color:#F4F0E8 !important; font-size:27px; line-height:1.2; }
.imr-app-modal > p { margin:0 auto; max-width:410px; color:#C0B8A9 !important; font-size:13px; line-height:1.7; }
.imr-app-modal-features { display:grid; gap:11px; margin:22px 0 24px; padding:17px; text-align:left; border:1px solid rgba(221,180,95,.15); border-radius:12px; background:rgba(255,255,255,.025); }
.imr-app-modal-features div { color:#E8E0D2; font-size:12px; }
.imr-app-modal-features span { margin-right:9px; color:#DDB45F; }
.imr-app-modal-download { width:100%; box-sizing:border-box; min-height:48px; }
.imr-app-modal-later { display:block; margin:15px auto 0; padding:7px 14px; border:0; background:transparent; color:#BDB5A7; font-size:12px; cursor:pointer; }
.imr-app-modal-later:hover { color:#F4F0E8; }
.imr-app-modal-note { margin-top:15px; color:#948B7D; font-size:9px; letter-spacing:1.2px; }
@media (max-width:700px) {
  .imr-app-download-card { align-items:flex-start; flex-wrap:wrap; gap:15px; padding:20px; }
  .imr-app-download-copy { flex-basis:calc(100% - 75px); }
  .imr-app-download-copy h2 { font-size:18px; }
  .imr-app-download-button { width:100%; box-sizing:border-box; }
  .imr-app-modal { padding:32px 22px 23px; }
  .imr-app-modal h2 { font-size:23px; }
}

/* =========================================================
   IMR ANDROID DOWNLOAD — LIGHT MODE TEXT CONTRAST FIX
   Keep download card and popup dark in both themes.
   ========================================================= */

html[data-theme="light"] .imr-app-download-card,
html[data-theme="dark"] .imr-app-download-card {
    background:
        radial-gradient(circle at 88% 50%, rgba(221,180,95,.13), transparent 34%),
        #211D12 !important;
    color: #F4F0E8 !important;
}

html[data-theme="light"] .imr-app-download-copy h2,
html[data-theme="dark"] .imr-app-download-copy h2 {
    color: #F4F0E8 !important;
}

html[data-theme="light"] .imr-app-download-copy p,
html[data-theme="dark"] .imr-app-download-copy p {
    color: #C0B8A9 !important;
}

html[data-theme="light"] .imr-app-download-meta,
html[data-theme="dark"] .imr-app-download-meta {
    color: #DDB45F !important;
}

/* Popup */
html[data-theme="light"] .imr-app-modal,
html[data-theme="dark"] .imr-app-modal {
    background:
        radial-gradient(circle at 50% 0%, rgba(221,180,95,.13), transparent 42%),
        #211D12 !important;
    color: #F4F0E8 !important;
}

html[data-theme="light"] .imr-app-modal h2,
html[data-theme="dark"] .imr-app-modal h2 {
    color: #F4F0E8 !important;
}

html[data-theme="light"] .imr-app-modal > p,
html[data-theme="dark"] .imr-app-modal > p {
    color: #C0B8A9 !important;
}

html[data-theme="light"] .imr-app-modal-features div,
html[data-theme="dark"] .imr-app-modal-features div {
    color: #E8E0D2 !important;
}

html[data-theme="light"] .imr-app-modal-later,
html[data-theme="dark"] .imr-app-modal-later {
    color: #BDB5A7 !important;
}

html[data-theme="light"] .imr-app-modal-note,
html[data-theme="dark"] .imr-app-modal-note {
    color: #948B7D !important;
}
