/* ==========================================================================
   TabloTala - shadcn/ui Inspired Master Rate Board & Financial Terminal
   سیستم نرخ‌نامه مالی و زرگری - طراحی استاندارد، بدون اسکرول، کنتراست و خوانایی فوق‌العاده
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800;900&display=swap');

/* ==========================================================================
   Typography Definitions (فونت اختصاصی زرگری و مالی)
   فونت عنوان‌ها: cinema
   فونت متون، دکمه‌ها و اعداد: kalame
   ========================================================================== */
@font-face {
  font-family: 'cinema';
  src: url('../fonts/Cinema.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Cinema';
  src: url('../fonts/Cinema.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'kalame';
  src: url('../fonts/Kalameh-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'kalame';
  src: url('../fonts/Kalameh-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'kalame';
  src: url('../fonts/Kalameh-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'kalame';
  src: url('../fonts/Kalameh-Black.ttf') format('truetype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Kalameh';
  src: url('../fonts/Kalameh-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Kalameh';
  src: url('../fonts/Kalameh-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Kalameh';
  src: url('../fonts/Kalameh-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Kalameh';
  src: url('../fonts/Kalameh-Black.ttf') format('truetype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Font Family Variables */
  --font-title: 'cinema', 'Cinema', 'kalame', 'Kalameh', sans-serif;
  --font-body: 'kalame', 'Kalameh', sans-serif;

  /* Premium Financial Light Theme Tokens (طراحی استاندارد روشن، شفاف و شارپ تابلوی طلا) */
  --background: #f4f6fa;
  --foreground: #0f172a;
  --card: #ffffff;
  --card-foreground: #0f172a;
  --primary: #0f172a;
  --primary-foreground: #ffffff;
  --secondary: #f1f5f9;
  --secondary-foreground: #0f172a;
  --muted: #f8fafc;
  --muted-foreground: #64748b;
  --accent: #f8fafc;
  --accent-foreground: #0f172a;
  --border: #e2e8f0;
  --border-subtle: #f1f5f9;
  --ring: #94a3b8;
  --radius: 0.75rem;

  /* Financial Color Tokens (Light Mode - پرکنتراست و شفاف) */
  --gold: #d97706;
  --gold-bg: #fffbeb;
  --gold-border: #fde68a;
  --gold-text: #92400e;

  --emerald: #059669;
  --emerald-bg: #ecfdf5;
  --emerald-border: #a7f3d0;
  --emerald-text: #047857;

  --rose: #e11d48;
  --rose-bg: #fff1f2;
  --rose-border: #fecdd3;
  --rose-text: #be123c;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
}

/* Zero-Scroll Strict Constraints for TV */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

html, body {
  width: 100vw;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden !important;
}

body {
  font-family: var(--font-body);
  background-color: var(--background);
  color: var(--foreground);
  direction: rtl;
  display: flex;
  flex-direction: column;
  line-height: 1.4;
  user-select: none;
  position: relative;
}

/* عناوین: تماماً با فونت سینما (cinema) */
h1, h2, h3, h4, h5, h6,
.brand-title,
.card-title,
.section-title,
.modal-title,
.tab-title {
  font-family: var(--font-title) !important;
}

/* سایر متون، اعداد، دکمه‌ها و قیمت‌ها: تماماً با فونت کلمه (kalame) */
button,
input,
select,
textarea,
.tab-pill,
.tab-badge,
.price-value,
.num-sell,
.num-buy,
.price-label,
.price-unit,
.ticker-msg,
.ticker-label,
.header-date,
.header-clock,
.badge-state,
.btn-slide-toggle,
.slide-label,
.slide-countdown,
.shop-meta,
.brand-subtitle,
.clock-text,
.date-text {
  font-family: var(--font-body) !important;
}

.board-container {
  width: 100vw;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px 16px;
  box-sizing: border-box;
  gap: 6px;
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   Luxury Gold Ambient Dynamic Background (پس‌زمینه متحرک و درخشان طلا و ارز)
   ========================================================================== */
.gold-ambient-backdrop {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.gold-aura-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(85px);
  opacity: 0.5;
  will-change: transform;
}

.gold-aura-orb.orb-1 {
  top: -12%;
  right: -8%;
  width: 55vw;
  height: 55vh;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.35) 0%, rgba(217, 119, 6, 0.16) 45%, transparent 70%);
  animation: goldOrbFloat1 22s ease-in-out infinite alternate;
}

.gold-aura-orb.orb-2 {
  bottom: -15%;
  left: -10%;
  width: 58vw;
  height: 58vh;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.32) 0%, rgba(245, 158, 11, 0.12) 45%, transparent 70%);
  animation: goldOrbFloat2 26s ease-in-out infinite alternate;
}

.gold-aura-orb.orb-3 {
  top: 35%;
  left: 25%;
  width: 45vw;
  height: 45vh;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.16) 0%, rgba(245, 158, 11, 0.1) 45%, transparent 70%);
  animation: goldOrbFloat3 30s ease-in-out infinite alternate;
}

.gold-mesh-pattern {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(217, 119, 6, 0.08) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.55;
}

@keyframes goldOrbFloat1 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-6vw, 8vh) scale(1.1); }
  100% { transform: translate(4vw, 4vh) scale(0.96); }
}

@keyframes goldOrbFloat2 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(8vw, -10vh) scale(1.12); }
  100% { transform: translate(-4vw, -3vh) scale(0.94); }
}

@keyframes goldOrbFloat3 {
  0% { transform: translate(0, 0) scale(0.96); }
  50% { transform: translate(-10vw, -6vh) scale(1.08); }
  100% { transform: translate(6vw, 8vh) scale(1.02); }
}

/* ==========================================================================
   Header Navbar
   ========================================================================== */
.header-card {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--gold-bg);
  border: 1px solid var(--gold-border);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(217, 119, 6, 0.2);
  animation: brandGoldBreathing 4s ease-in-out infinite;
}

@keyframes brandGoldBreathing {
  0%, 100% {
    box-shadow: 0 0 10px rgba(217, 119, 6, 0.18);
  }
  50% {
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.42);
  }
}

.brand-info h1 {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--foreground);
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
  background: var(--secondary);
  color: var(--muted-foreground);
  border: 1px solid var(--border);
}

.badge-gold {
  background: var(--gold-bg);
  color: var(--gold-text);
  border-color: var(--gold-border);
}

.brand-info p {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  font-weight: 600;
}

/* Header Center Meta */
.header-center {
  display: flex;
  align-items: center;
  gap: 16px;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--emerald-bg);
  border: 1px solid var(--emerald-border);
  color: var(--emerald-text);
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--emerald);
  animation: pulse-dot 1.8s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

.clock-date-group {
  display: flex;
  align-items: center;
  gap: 14px;
  border-left: 1px solid var(--border);
  padding-left: 14px;
}

.date-text {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--foreground);
}

.clock-text {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}

/* Header Actions */
.header-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Discreet Settings Button (!) - مخفی و نامحسوس جهت تنظیم نرخ‌ها */
.btn-secret-settings {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted-foreground);
  opacity: 0.55;
  transition: all 0.25s ease;
  cursor: pointer;
  user-select: none;
  text-decoration: none;
}

.btn-secret-settings:hover {
  opacity: 1;
  background: var(--muted);
  border-color: var(--gold);
  color: var(--foreground);
}

.secret-icon-exclamation {
  font-family: var(--font-body) !important;
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1;
  display: inline-block;
}

.btn-shadcn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: calc(var(--radius) - 3px);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--foreground);
  text-decoration: none;
}

.btn-shadcn:hover {
  background: var(--muted);
  color: var(--foreground);
}

.btn-shadcn-icon {
  width: 32px;
  padding: 0;
}

.btn-shadcn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

.btn-shadcn-primary:hover {
  opacity: 0.9;
}

/* ==========================================================================
   Master Rate Table (جدول مالی یکپارچه زرگری و صرافی)
   ========================================================================== */
/* ==========================================================================
   3x3 Box Grid & Unique Card Themes (باکس‌های اختصاصی ۹‌گانه طلا و ارز)
   ========================================================================== */
.boxes-grid-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 8px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  animation: panelGoldFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* چیدمان متوازن و بدون فضای خالی برای ۷ باکس طلا و ارز (۳ باکس طلا بالا، ۴ باکس ارز پایین) */
.gold-curr-grid-container {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: 1.06fr 1fr;
  gap: 10px;
}

.gold-curr-grid-container #card_gold18k,
.gold-curr-grid-container #card_mazanehCash,
.gold-curr-grid-container #card_mazanehRemittance {
  grid-column: span 4;
}

.gold-curr-grid-container #card_usdtTether,
.gold-curr-grid-container #card_usd,
.gold-curr-grid-container #card_eurCash,
.gold-curr-grid-container #card_iqdDinar {
  grid-column: span 3;
}

/* مدیریت قطعی مخفی‌سازی تب‌های غیرفعال برای جلوگیری از تداخل و اسکرول */
.tab-panel-hidden,
#panelGoldCurr.tab-panel-hidden,
#panelCoins.tab-panel-hidden,
.boxes-grid-container[style*="display: none"],
#panelGoldCurr[style*="display: none"],
#panelCoins[style*="display: none"] {
  display: none !important;
}

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

.rate-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px 14px;
  min-height: 0;
  overflow: hidden;
  position: relative;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* افکت صیقل و بازتاب نور شمش طلا روی کارت‌ها */
.rate-card::before {
  content: '';
  position: absolute;
  top: -60%;
  left: -130%;
  width: 70%;
  height: 220%;
  background: linear-gradient(
    105deg,
    transparent 15%,
    rgba(255, 255, 255, 0.04) 30%,
    rgba(251, 191, 36, 0.2) 48%,
    rgba(255, 255, 255, 0.45) 50%,
    rgba(251, 191, 36, 0.2) 52%,
    rgba(255, 255, 255, 0.04) 70%,
    transparent 85%
  );
  transform: rotate(24deg);
  pointer-events: none;
  opacity: 0;
  z-index: 2;
  animation: goldBullionSheen 8.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes goldBullionSheen {
  0% {
    left: -130%;
    opacity: 0;
  }
  8% {
    opacity: 1;
  }
  32% {
    left: 170%;
    opacity: 1;
  }
  33%, 100% {
    left: 170%;
    opacity: 0;
  }
}

/* توالی درخشش متناوب کارت‌های ویترین طلا */
.boxes-grid-container > .rate-card:nth-child(1)::before { animation-delay: 0.2s; }
.boxes-grid-container > .rate-card:nth-child(2)::before { animation-delay: 1.1s; }
.boxes-grid-container > .rate-card:nth-child(3)::before { animation-delay: 2.0s; }
.boxes-grid-container > .rate-card:nth-child(4)::before { animation-delay: 2.9s; }
.boxes-grid-container > .rate-card:nth-child(5)::before { animation-delay: 3.8s; }
.boxes-grid-container > .rate-card:nth-child(6)::before { animation-delay: 4.7s; }
.boxes-grid-container > .rate-card:nth-child(7)::before { animation-delay: 5.6s; }
.boxes-grid-container > .rate-card:nth-child(8)::before { animation-delay: 6.5s; }

.rate-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(217, 119, 6, 0.12), 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Card Header */
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
  margin-bottom: 2px;
}

.card-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.card-badge-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 900;
  flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
  color: #fff;
}

.card-title {
  font-family: var(--font-title);
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--foreground);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: normal !important;
  font-synthesis: none;
}

/* Card Prices Grid (Buy & Sell side-by-side) */
.card-prices-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  background: rgba(0, 0, 0, 0.035);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: calc(var(--radius) - 2px);
  padding: 8px 12px;
  gap: 8px;
  margin: 0;
}

.price-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.price-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--muted-foreground);
  margin-bottom: 2px;
  letter-spacing: normal !important;
}

.price-value-wrap {
  display: flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
}

.num-sell {
  font-size: 1.85rem;
  font-weight: 900;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
  letter-spacing: normal !important;
  line-height: 1.1;
}

.num-buy {
  font-size: 1.85rem;
  font-weight: 900;
  color: #059669;
  font-variant-numeric: tabular-nums;
  letter-spacing: normal !important;
  line-height: 1.1;
}

.price-unit {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--muted-foreground);
}

.price-divider {
  width: 1.5px;
  height: 40px;
  background: var(--border);
  opacity: 0.8;
}

/* ==========================================================================
   9 UNIQUE THEMES (رنگ‌های درخشان و پرکنتراست بازار مالی)
   ========================================================================== */

/* 1. طلای ۱۸ عیار */
.card-theme-gold18k {
  background: linear-gradient(145deg, rgba(254, 240, 138, 0.3) 0%, rgba(253, 230, 138, 0.1) 100%), var(--card);
  border-color: #f59e0b;
  box-shadow: 0 4px 18px rgba(245, 158, 11, 0.2);
}
.card-theme-gold18k .card-badge-icon {
  background: linear-gradient(135deg, #f59e0b, #b45309);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}
.card-theme-gold18k .card-title {
  color: #b45309;
}

/* 2. مظنه نقدی (آبشده نقدی روز) */
.card-theme-mazaneh-cash {
  background: linear-gradient(145deg, rgba(253, 230, 138, 0.28) 0%, rgba(254, 243, 199, 0.1) 100%), var(--card);
  border-color: #d97706;
  box-shadow: 0 4px 18px rgba(217, 119, 6, 0.2);
}
.card-theme-mazaneh-cash .card-badge-icon {
  background: linear-gradient(135deg, #d97706, #92400e);
  box-shadow: 0 0 12px rgba(217, 119, 6, 0.4);
}
.card-theme-mazaneh-cash .card-title {
  color: #92400e;
}

/* 3. مظنه حواله (آبشده حواله‌ای) */
.card-theme-mazaneh-remit {
  background: linear-gradient(145deg, rgba(186, 230, 253, 0.35) 0%, rgba(224, 242, 254, 0.12) 100%), var(--card);
  border-color: #0284c7;
  box-shadow: 0 4px 18px rgba(2, 132, 199, 0.2);
}
.card-theme-mazaneh-remit .card-badge-icon {
  background: linear-gradient(135deg, #0284c7, #075985);
  box-shadow: 0 0 12px rgba(2, 132, 199, 0.4);
}
.card-theme-mazaneh-remit .card-title {
  color: #0369a1;
}

/* 4. تتر دیجیتال (USDT) */
.card-theme-tether {
  background: linear-gradient(145deg, rgba(167, 243, 208, 0.35) 0%, rgba(209, 250, 229, 0.12) 100%), var(--card);
  border-color: #10b981;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.22);
}
.card-theme-tether .card-badge-icon {
  background: linear-gradient(135deg, #10b981, #047857);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.45);
  font-size: 1.15rem;
}
.card-theme-tether .card-title {
  color: #047857;
}

/* 5. دلار آمریکا */
.card-theme-usd,
.card-theme-usd-tehran {
  background: linear-gradient(145deg, rgba(187, 247, 208, 0.35) 0%, rgba(220, 252, 231, 0.12) 100%), var(--card);
  border-color: #16a34a;
  box-shadow: 0 4px 20px rgba(22, 163, 74, 0.22);
}
.card-theme-usd .card-badge-icon,
.card-theme-usd-tehran .card-badge-icon {
  background: linear-gradient(135deg, #16a34a, #14532d);
  box-shadow: 0 0 14px rgba(22, 163, 74, 0.45);
  font-size: 1.15rem;
  font-weight: 900;
}
.card-theme-usd .card-title,
.card-theme-usd-tehran .card-title {
  color: #15803d;
}

/* 6. دلار هرات نقدی */
.card-theme-usd-herat-cash {
  background: linear-gradient(145deg, rgba(153, 246, 228, 0.32) 0%, rgba(204, 251, 241, 0.1) 100%), var(--card);
  border-color: #0d9488;
  box-shadow: 0 4px 18px rgba(13, 148, 136, 0.2);
}
.card-theme-usd-herat-cash .card-badge-icon {
  background: linear-gradient(135deg, #0d9488, #115e59);
  box-shadow: 0 0 12px rgba(13, 148, 136, 0.4);
}
.card-theme-usd-herat-cash .card-title {
  color: #0f766e;
}

/* 7. دلار هرات فردایی */
.card-theme-usd-herat-tomorrow {
  background: linear-gradient(145deg, rgba(233, 213, 255, 0.35) 0%, rgba(243, 232, 255, 0.12) 100%), var(--card);
  border-color: #9333ea;
  box-shadow: 0 4px 18px rgba(147, 51, 234, 0.2);
}
.card-theme-usd-herat-tomorrow .card-badge-icon {
  background: linear-gradient(135deg, #9333ea, #581c87);
  box-shadow: 0 0 12px rgba(147, 51, 234, 0.4);
  font-size: 0.72rem;
}
.card-theme-usd-herat-tomorrow .card-title {
  color: #7e22ce;
}

/* 8. یورو نقدی */
.card-theme-eur {
  background: linear-gradient(145deg, rgba(199, 210, 254, 0.35) 0%, rgba(224, 231, 255, 0.12) 100%), var(--card);
  border-color: #4f46e5;
  box-shadow: 0 4px 18px rgba(79, 70, 229, 0.2);
}
.card-theme-eur .card-badge-icon {
  background: linear-gradient(135deg, #4f46e5, #312e81);
  box-shadow: 0 0 12px rgba(79, 70, 229, 0.4);
  font-size: 1.15rem;
}
.card-theme-eur .card-title {
  color: #3730a3;
}

/* 9. دینار عراق */
.card-theme-dinar {
  background: linear-gradient(145deg, rgba(254, 205, 211, 0.35) 0%, rgba(255, 228, 230, 0.12) 100%), var(--card);
  border-color: #e11d48;
  box-shadow: 0 4px 18px rgba(225, 29, 72, 0.2);
}
.card-theme-dinar .card-badge-icon {
  background: linear-gradient(135deg, #e11d48, #9f1239);
  box-shadow: 0 0 12px rgba(225, 29, 72, 0.4);
  font-size: 0.76rem;
}
.card-theme-dinar .card-title {
  color: #be123c;
}

/* ==========================================================================
   Closed / Inactive State (وضعیت بسته بودن معاملات روی تابلو)
   ========================================================================== */
.rate-card.is-closed {
  border-color: rgba(239, 68, 68, 0.55) !important;
  background: radial-gradient(circle at top right, rgba(239, 68, 68, 0.12), transparent 70%), var(--card) !important;
}

.card-closed-banner {
  display: none;
  align-items: center;
  gap: 4px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 7px;
  letter-spacing: normal !important;
  animation: pulseClosed 2.2s infinite ease-in-out;
}

@keyframes pulseClosed {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.82; transform: scale(0.98); }
}

.rate-card.is-closed .card-closed-banner {
  display: inline-flex;
}

.rate-card.is-closed .card-trend-box {
  display: none;
}

.rate-card.is-closed .card-prices-grid {
  opacity: 0.68;
}

.rate-card.buy-closed .num-buy {
  opacity: 0.5;
  text-decoration: line-through;
  text-decoration-color: #ef4444;
}

.rate-card.sell-closed .num-sell {
  opacity: 0.5;
  text-decoration: line-through;
  text-decoration-color: #ef4444;
}

/* Column 4: Spread Badge */
.cell-spread {
  display: flex;
  align-items: center;
  justify-content: center;
}

.spread-pill {
  padding: 3px 10px;
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--foreground);
}

.hero-18k-row .spread-pill {
  background: #ffffff;
  border-color: var(--gold-border);
  color: var(--gold-text);
}

/* Column 5: Trend Badge */
.cell-trend {
  display: flex;
  align-items: center;
  justify-content: center;
}

.trend-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 800;
}

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

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

.trend-badge.flat {
  background: var(--secondary);
  border: 1px solid var(--border);
  color: var(--muted-foreground);
}

/* Flash Animations */
.price-flash-up {
  animation: flash-green 1.2s ease;
}

.price-flash-down {
  animation: flash-red 1.2s ease;
}

@keyframes flash-green {
  0% {
    background-color: var(--emerald-bg) !important;
    border-color: var(--emerald) !important;
  }
  100% {
    background-color: transparent;
  }
}

@keyframes flash-red {
  0% {
    background-color: var(--rose-bg) !important;
    border-color: var(--rose) !important;
  }
  100% {
    background-color: transparent;
  }
}

/* ==========================================================================
   Bottom Marquee Ticker
   ========================================================================== */
.ticker-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}

.ticker-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, #d97706 25%, #fbbf24 50%, #10b981 75%, transparent 100%);
  background-size: 200% 100%;
  animation: tickerGoldStream 6s linear infinite;
  pointer-events: none;
}

@keyframes tickerGoldStream {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.ticker-badge-lead {
  background: var(--gold-bg);
  border: 1px solid var(--gold-border);
  color: var(--gold-text);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 5px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.ticker-track {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
}

.ticker-msg {
  display: inline-block;
  padding-right: 100%;
  animation: ticker-loop 30s linear infinite;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--foreground);
}

.ticker-track:hover .ticker-msg {
  animation-play-state: paused;
}

@keyframes ticker-loop {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Footer */
.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
  font-size: 0.7rem;
  color: var(--muted-foreground);
  font-weight: 600;
  flex-shrink: 0;
}

/* ==========================================================================
   In-App Quick Settings Modal (shadcn Dialog)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.96);
  transition: transform 0.2s ease;
}

.modal-backdrop.open .modal-dialog {
  transform: scale(1);
}

.modal-header {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--secondary);
}

.modal-header h2 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--foreground);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-body {
  padding: 14px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: calc(90vh - 120px);
}

.modal-footer {
  padding: 10px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--secondary);
}

.modal-grid-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.quick-edit-row {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.quick-edit-row label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--foreground);
  display: flex;
  justify-content: space-between;
}

.quick-input-group {
  display: flex;
  gap: 6px;
}

.quick-input-group input {
  flex: 1;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--foreground);
  font-family: inherit;
  outline: none;
}

.quick-input-group input:focus {
  border-color: var(--ring);
}

/* Toast */
.toast-msg {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--primary);
  color: var(--primary-foreground);
  border-radius: 9999px;
  padding: 8px 20px;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 2000;
  pointer-events: none;
}

.toast-msg.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ==========================================================================
   Board Navigation Tabs & TV Auto-Slide Controls
   (طراحی تمام‌عرض دو تب اصلی بازار طلا/ارز و سکه - تقسیم متوازن ۵۰-۵۰)
   ========================================================================== */
.board-nav-bar {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  flex-shrink: 0;
}

.board-tabs-list {
  flex: 1;
  display: flex;
  align-items: stretch;
  gap: 8px;
  background: var(--muted);
  padding: 4px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.04);
}

.tab-pill {
  flex: 1 1 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 6px 16px;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--muted-foreground);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  position: relative;
  overflow: hidden;
}

.tab-pill:hover {
  color: var(--foreground);
  background: rgba(255, 255, 255, 0.45);
}

.tab-pill.active {
  background: var(--card);
  color: var(--gold);
  box-shadow: 0 2px 10px rgba(217, 119, 6, 0.16), 0 1px 3px rgba(0, 0, 0, 0.06);
  border-color: rgba(217, 119, 6, 0.35);
}

.tab-pill .tab-title {
  font-family: var(--font-title) !important;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: normal !important;
}

.tab-pill .tab-badge {
  font-family: var(--font-body) !important;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 9999px;
  background: rgba(217, 119, 6, 0.12);
  color: var(--gold-text);
  font-weight: 700;
}

.auto-slide-wrap {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.btn-slide-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted-foreground);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-body) !important;
}

.btn-slide-toggle:hover {
  color: var(--foreground);
  border-color: var(--primary);
}

.btn-slide-toggle.active {
  color: #15803d;
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.35);
}

.slide-indicator-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a1a1aa;
  transition: background 0.2s ease;
}

.btn-slide-toggle.active .slide-indicator-dot {
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.slide-countdown {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.06);
  color: inherit;
}

/* ==========================================================================
   Coins Grid Container (چیدمان ۲ ستونه در ۳ ردیف برای سکه‌ها)
   ========================================================================== */
.coins-grid-container {
  grid-template-columns: repeat(2, 1fr) !important;
  grid-template-rows: repeat(3, 1fr) !important;
  gap: 10px !important;
}

/* ==========================================================================
   Coin Card Themes (تم‌های اختصاصی سکه‌های بانکی و غیربانکی)
   ========================================================================== */

/* 1. سکه تمام امامی ۸۶ بانکی */
.card-theme-coin-emam {
  background: linear-gradient(145deg, rgba(254, 240, 138, 0.35) 0%, rgba(253, 230, 138, 0.12) 100%), var(--card);
  border-color: #eab308;
  box-shadow: 0 4px 18px rgba(234, 179, 8, 0.22);
}
.card-theme-coin-emam .card-badge-icon {
  background: linear-gradient(135deg, #eab308, #ca8a04);
  box-shadow: 0 0 12px rgba(234, 179, 8, 0.4);
  font-size: 1.15rem;
}
.card-theme-coin-emam .card-title {
  color: #a16207;
}

/* 2. تمام سکه بهار غیربانکی */
.card-theme-coin-tamam-nb {
  background: linear-gradient(145deg, rgba(254, 215, 170, 0.35) 0%, rgba(255, 237, 213, 0.12) 100%), var(--card);
  border-color: #ea580c;
  box-shadow: 0 4px 18px rgba(234, 88, 12, 0.22);
}
.card-theme-coin-tamam-nb .card-badge-icon {
  background: linear-gradient(135deg, #ea580c, #c2410c);
  box-shadow: 0 0 12px rgba(234, 88, 12, 0.4);
  font-size: 0.8rem;
  font-weight: 900;
}
.card-theme-coin-tamam-nb .card-title {
  color: #c2410c;
}

/* 3. نیم سکه بهار ۸۶ بانکی */
.card-theme-coin-nim {
  background: linear-gradient(145deg, rgba(254, 240, 138, 0.32) 0%, rgba(253, 230, 138, 0.1) 100%), var(--card);
  border-color: #d97706;
  box-shadow: 0 4px 18px rgba(217, 119, 6, 0.22);
}
.card-theme-coin-nim .card-badge-icon {
  background: linear-gradient(135deg, #d97706, #b45309);
  box-shadow: 0 0 12px rgba(217, 119, 6, 0.4);
  font-size: 0.95rem;
  font-weight: 900;
}
.card-theme-coin-nim .card-title {
  color: #b45309;
}

/* 4. نیم سکه بهار غیربانکی */
.card-theme-coin-nim-nb {
  background: linear-gradient(145deg, rgba(254, 215, 170, 0.32) 0%, rgba(255, 237, 213, 0.1) 100%), var(--card);
  border-color: #c2410c;
  box-shadow: 0 4px 18px rgba(194, 65, 12, 0.22);
}
.card-theme-coin-nim-nb .card-badge-icon {
  background: linear-gradient(135deg, #c2410c, #9a3412);
  box-shadow: 0 0 12px rgba(194, 65, 12, 0.4);
  font-size: 0.8rem;
  font-weight: 900;
}
.card-theme-coin-nim-nb .card-title {
  color: #9a3412;
}

/* 5. ربع سکه بهار ۸۶ بانکی */
.card-theme-coin-rob {
  background: linear-gradient(145deg, rgba(254, 240, 138, 0.3) 0%, rgba(253, 230, 138, 0.1) 100%), var(--card);
  border-color: #ca8a04;
  box-shadow: 0 4px 18px rgba(202, 138, 4, 0.22);
}
.card-theme-coin-rob .card-badge-icon {
  background: linear-gradient(135deg, #ca8a04, #a16207);
  box-shadow: 0 0 12px rgba(202, 138, 4, 0.4);
  font-size: 0.95rem;
  font-weight: 900;
}
.card-theme-coin-rob .card-title {
  color: #a16207;
}

/* 6. ربع سکه بهار غیربانکی */
.card-theme-coin-rob-nb {
  background: linear-gradient(145deg, rgba(254, 215, 170, 0.3) 0%, rgba(255, 237, 213, 0.1) 100%), var(--card);
  border-color: #b45309;
  box-shadow: 0 4px 18px rgba(180, 83, 9, 0.22);
}
.card-theme-coin-rob-nb .card-badge-icon {
  background: linear-gradient(135deg, #b45309, #78350f);
  box-shadow: 0 0 12px rgba(180, 83, 9, 0.4);
  font-size: 0.8rem;
  font-weight: 900;
}
.card-theme-coin-rob-nb .card-title {
  color: #78350f;
}

.badge-nb {
  letter-spacing: normal !important;
}

/* ==========================================================================
   Responsive Design (طراحی ریسپانسیو اختصاصی تابلوی طلا و ارز برای موبایل و تبلت)
   تجربه کاربری ممتاز در موبایل مشابه برترین اپلیکیشن‌های مالی، صرافی و تریدینگ
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tablets & Medium Screens (769px to 1023px)
   -------------------------------------------------------------------------- */
@media (min-width: 769px) and (max-width: 1023px) {
  html, body {
    width: 100%;
    height: auto !important;
    min-height: 100vh !important;
    max-height: none !important;
    overflow-x: clip !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .board-container {
    width: 100%;
    height: auto !important;
    min-height: 100vh !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 12px 16px 28px !important;
    gap: 12px !important;
    justify-content: flex-start !important;
  }

  .header-card {
    padding: 10px 16px !important;
  }

  .brand-info h1 {
    font-size: 1.2rem !important;
  }

  .brand-info p {
    font-size: 0.74rem !important;
  }

  .header-center {
    gap: 12px !important;
  }

  .clock-text {
    font-size: 1.2rem !important;
  }

  .gold-curr-grid-container {
    grid-template-columns: repeat(2, 1fr) !important;
    grid-template-rows: auto !important;
    gap: 12px !important;
    overflow: visible !important;
  }

  .gold-curr-grid-container #card_gold18k {
    grid-column: span 2 !important;
  }

  .gold-curr-grid-container #card_mazanehCash,
  .gold-curr-grid-container #card_mazanehRemittance,
  .gold-curr-grid-container #card_usdtTether,
  .gold-curr-grid-container #card_usd,
  .gold-curr-grid-container #card_eurCash,
  .gold-curr-grid-container #card_iqdDinar {
    grid-column: span 1 !important;
  }

  .coins-grid-container {
    grid-template-columns: repeat(2, 1fr) !important;
    grid-template-rows: auto !important;
    gap: 12px !important;
    overflow: visible !important;
  }

  .rate-card {
    min-height: auto !important;
    padding: 12px 14px !important;
    gap: 10px !important;
  }

  .num-sell,
  .num-buy {
    font-size: 1.65rem !important;
  }

  .footer-row {
    padding: 12px 4px 6px !important;
  }
}

/* --------------------------------------------------------------------------
   2. Mobile Phones (Up to 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  html {
    width: 100%;
    height: auto !important;
    overflow-x: clip !important;
    overflow-y: auto !important;
  }

  body {
    width: 100%;
    height: auto !important;
    min-height: 100vh !important;
    max-height: none !important;
    overflow-x: clip !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch;
  }

  .board-container {
    width: 100%;
    height: auto !important;
    min-height: 100vh !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 8px 10px calc(24px + env(safe-area-inset-bottom, 14px)) !important;
    gap: 10px !important;
    justify-content: flex-start !important;
  }

  /* هدر در موبایل: چیدمان دو لایه شفاف و تمیز داشبورد مالی */
  .header-card {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    grid-template-areas:
      "brand controls"
      "center center" !important;
    gap: 8px 6px !important;
    padding: 10px 12px !important;
    border-radius: 12px !important;
  }

  .brand-wrapper {
    grid-area: brand !important;
    min-width: 0 !important;
    gap: 8px !important;
  }

  .brand-icon {
    width: 32px !important;
    height: 32px !important;
    border-radius: 8px !important;
  }

  .brand-icon svg {
    width: 18px !important;
    height: 18px !important;
  }

  .brand-info h1 {
    font-size: 1.1rem !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
    margin-bottom: 2px !important;
  }

  .brand-info h1 #headerShopTitle {
    font-weight: 900;
  }

  .badge-tag {
    font-size: 0.68rem !important;
    padding: 1px 6px !important;
  }

  .brand-info p {
    font-size: 0.68rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 220px;
  }

  .header-controls {
    grid-area: controls !important;
    align-self: center !important;
    justify-self: end !important;
  }

  .btn-secret-settings {
    width: 34px !important;
    height: 34px !important;
    opacity: 0.7 !important;
  }

  .header-center {
    grid-area: center !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    padding-top: 8px !important;
    border-top: 1px solid var(--border) !important;
    gap: 6px !important;
  }

  .status-pill {
    padding: 2px 7px !important;
    font-size: 0.68rem !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
  }

  #btnSyncApi {
    height: 26px !important;
    width: 26px !important;
    flex-shrink: 0 !important;
  }

  .clock-date-group {
    border-left: none !important;
    padding-left: 0 !important;
    gap: 8px !important;
    display: flex !important;
    align-items: center !important;
  }

  .date-text {
    font-size: 0.74rem !important;
    color: var(--muted-foreground) !important;
  }

  .clock-text {
    font-size: 1.15rem !important;
    font-weight: 900 !important;
  }

  /* نوار پیام متحرک تابلو در موبایل */
  .ticker-card {
    padding: 4px 8px !important;
    gap: 8px !important;
    border-radius: 8px !important;
  }

  .ticker-badge-lead {
    padding: 2px 6px !important;
    font-size: 0.68rem !important;
    gap: 4px !important;
  }

  .ticker-msg {
    font-size: 0.74rem !important;
  }

  /* نوار تب‌های انتخاب بازار و چرخش خودکار در موبایل - چسبان (Sticky) با بلر شیشه‌ای */
  .board-nav-bar {
    flex-direction: column !important;
    gap: 6px !important;
    margin-bottom: 2px !important;
    position: sticky !important;
    top: 0px !important;
    z-index: 100 !important;
    padding-top: 4px !important;
    padding-bottom: 4px !important;
    background: rgba(244, 246, 250, 0.95) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
  }

  .board-tabs-list {
    width: 100% !important;
    gap: 4px !important;
    padding: 4px !important;
    background: rgba(244, 246, 250, 0.94) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08) !important;
    border-radius: 10px !important;
  }

  .tab-pill {
    padding: 8px 6px !important;
    gap: 6px !important;
    border-radius: 8px !important;
  }

  .tab-pill .tab-icon {
    font-size: 0.9rem !important;
  }

  .tab-pill .tab-title {
    font-size: 0.9rem !important;
    font-weight: 800 !important;
  }

  .tab-pill .tab-badge {
    font-size: 0.65rem !important;
    padding: 1px 5px !important;
  }

  .auto-slide-wrap {
    width: 100% !important;
  }

  .btn-slide-toggle {
    width: 100% !important;
    justify-content: center !important;
    padding: 6px 10px !important;
    font-size: 0.72rem !important;
    border-radius: 8px !important;
  }

  /* ساختار کارت‌های قیمت در موبایل به صورت لیست تک‌ستونه فوق‌العاده خوانا */
  .boxes-grid-container,
  .gold-curr-grid-container,
  .coins-grid-container {
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: auto !important;
    gap: 10px !important;
    overflow: visible !important;
    flex: none !important;
  }

  .gold-curr-grid-container #card_gold18k,
  .gold-curr-grid-container #card_mazanehCash,
  .gold-curr-grid-container #card_mazanehRemittance,
  .gold-curr-grid-container #card_usdtTether,
  .gold-curr-grid-container #card_usd,
  .gold-curr-grid-container #card_eurCash,
  .gold-curr-grid-container #card_iqdDinar {
    grid-column: span 1 !important;
  }

  /* کارت‌های نرخ در موبایل */
  .rate-card {
    min-height: auto !important;
    padding: 12px 14px !important;
    border-radius: 14px !important;
    gap: 10px !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05) !important;
  }

  .rate-card:active {
    transform: scale(0.985);
  }

  .card-head {
    margin-bottom: 2px !important;
  }

  .card-identity {
    gap: 10px !important;
  }

  .card-badge-icon {
    width: 36px !important;
    height: 36px !important;
    border-radius: 10px !important;
    font-size: 0.88rem !important;
  }

  .card-title {
    font-size: 1.1rem !important;
    white-space: normal !important;
    line-height: 1.3 !important;
  }

  .card-closed-banner {
    font-size: 0.68rem !important;
    padding: 2px 6px !important;
  }

  /* گرید قیمت‌های خرید و فروش در موبایل */
  .card-prices-grid {
    padding: 9px 12px !important;
    gap: 8px !important;
    border-radius: 10px !important;
  }

  .price-label {
    font-size: 0.74rem !important;
    margin-bottom: 2px !important;
  }

  .price-value-wrap {
    gap: 4px !important;
  }

  .num-sell {
    font-size: 1.62rem !important;
    line-height: 1.1 !important;
  }

  .num-buy {
    font-size: 1.62rem !important;
    line-height: 1.1 !important;
  }

  .price-unit {
    font-size: 0.7rem !important;
  }

  .price-divider {
    height: 40px !important;
  }

  /* پاورقی در موبایل */
  .footer-row {
    flex-direction: column !important;
    gap: 5px !important;
    text-align: center !important;
    font-size: 0.72rem !important;
    padding: 10px 4px 6px !important;
    border-top: 1px solid var(--border) !important;
    margin-top: 6px !important;
  }

  /* مدال تنظیمات سریع در موبایل */
  .modal-dialog {
    width: 95% !important;
    max-height: 90vh !important;
    border-radius: 12px !important;
  }

  .modal-header h2 {
    font-size: 1rem !important;
  }

  .modal-body {
    padding: 12px !important;
  }

  .modal-grid-inputs {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .modal-footer {
    flex-direction: column !important;
    gap: 8px !important;
  }

  .modal-footer > div {
    width: 100% !important;
    justify-content: flex-end !important;
  }
}

/* --------------------------------------------------------------------------
   3. Small Smartphone Screens (Under 390px - e.g. iPhone SE)
   -------------------------------------------------------------------------- */
@media (max-width: 390px) {
  .header-center {
    flex-wrap: wrap !important;
  }

  .clock-date-group {
    width: 100% !important;
    justify-content: space-between !important;
  }

  .card-title {
    font-size: 1rem !important;
  }

  .num-sell,
  .num-buy {
    font-size: 1.42rem !important;
  }

  .price-label {
    font-size: 0.68rem !important;
  }

  .tab-pill .tab-title {
    font-size: 0.82rem !important;
  }
}


