/* MUTA v245 CONSOLIDATED 02 LAYOUT - SOURCES IN ABOUT > منابع - 0 !important */

/* === 03-layout.css === */
/* MUTA v200.81 - 03-layout.css - HEADER, NAV, VIEWS, SCROLL - CLEAN NO !IMPORTANT SPAM */

/* ===== HTML/BODY - SCROLL CLEAN ===== */
html {
  overflow-y: auto;
  overflow-x: clip;
  scroll-behavior: auto;
  touch-action: pan-y;
  scrollbar-gutter: stable;
}
body {
  overflow-y: auto;
  overflow-x: clip;
  position: relative;
  background: var(--bg);
  min-height: 100vh;
  touch-action: pan-y;
}
/* When menu open - simple overflow hidden, NO position fixed (prevents jump) */
body.menu-open-v200-81,
body.menu-open-v200-82 {
  overflow: hidden;
}
body.menu-open-v200-81 html,
body.menu-open-v200-82 html {
  overflow: hidden;
}
html.menu-open-v200-81,
html.menu-open-v200-82 {
  overflow: hidden;
}
/* When menu open, remove backdrop-filter from header to prevent fixed child clipping */
body.menu-open-v200-81 .site-header,
body.menu-open-v200-82 .site-header {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  filter: none !important;
  transform: none !important;
}

/* ===== HEADER - STICKY 56px, ALWAYS VISIBLE ===== */
.site-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  min-height: var(--header-h);
  z-index: 1001;
  display: flex;
  align-items: center;
  background: rgba(14,13,11,0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
/* Never hide header */
.site-header.header-hidden {
  transform: none;
  opacity: 1;
  visibility: visible;
  display: flex;
}
.header-inner {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: var(--header-h);
  width: 100%;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  user-select: none;
  text-decoration: none;
}
.brand-logo { width: 36px; height: 36px; aspect-ratio: 1; object-fit: contain; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-size: .88rem; font-weight: 700; color: var(--text); }
.brand-tag { font-size: .62rem; opacity: .55; letter-spacing: .08em; color: var(--text-dim); }

/* Header actions */
.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0; }
.theme-toggle, .lang-toggle {
  display: inline-flex;
  width: 36px; height: 36px;
  align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: rgba(255,255,255,.06);
  color: var(--text);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
}
.theme-toggle:hover, .lang-toggle:hover { background: rgba(255,255,255,.10); border-color: var(--line-3); }

/* ===== MENU TOGGLE - 40px ===== */
#menuToggleBtn {
  display: none;
  width: 40px; height: 40px;
  min-width: 40px; min-height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: rgba(255,255,255,.06);
  color: var(--text);
  align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  z-index: 1004;
  transition: all var(--dur-fast) var(--ease);
  touch-action: manipulation;
  user-select: none;
}
#menuToggleBtn:hover { background: rgba(255,255,255,.10); }
#menuToggleBtn:active { transform: scale(.96); }

/* ===== MAIN NAV - DESKTOP FLEX, MOBILE HIDDEN ===== */
.main-nav {
  display: flex;
  flex-direction: row;
  gap: 2px;
  height: var(--header-h);
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
  margin: 0 10px;
}
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
  text-decoration: none;
  user-select: none;
}
.main-nav a:hover { background: rgba(255,255,255,.06); color: var(--text); }
.main-nav a.active { background: var(--gold-soft); color: var(--gold); border-color: var(--gold-border); font-weight: 700; }
.main-nav a .nav-icon-svg { display: inline-flex; width: 16px; height: 16px; align-items: center; justify-content: center; }
.main-nav a .nav-icon-svg svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
#navAdminBtn { display: none; }
body.is-admin #navAdminBtn,
body.admin-logged-in #navAdminBtn { display: inline-flex; }

/* ===== OVERLAY ===== */
#menuOverlay {
  display: none;
  position: fixed;
  inset: 0;
  top: var(--header-h);
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 1000;
}
#menuOverlay.open { display: block; }

/* ===== DESKTOP (min-width: 1025px) ===== */
@media (min-width: 1025px) {
  #menuToggleBtn { display: none; }
  /* Desktop nav inside header */
  #mainNavDesktop {
    display: flex;
    position: static;
    visibility: visible;
    opacity: 1;
    flex-direction: row;
    height: var(--header-h);
    max-height: none;
    background: transparent;
    border: none;
    padding: 0;
    overflow-x: auto;
    overflow-y: visible;
  }
  /* Mobile nav hidden on desktop */
  #mainNav {
    display: none !important;
  }
  #menuOverlay { display: none; }
  #menuOverlay.open { display: none; }
  .main-nav {
    display: flex;
    position: static;
    visibility: visible;
    opacity: 1;
    flex-direction: row;
    height: var(--header-h);
    max-height: none;
    background: transparent;
    border: none;
    padding: 0;
    overflow-x: auto;
    overflow-y: visible;
  }
}

/* ===== MOBILE (max-width: 1024px) - FULL SCREEN FIX v82 - NAV OUTSIDE HEADER ===== */
@media (max-width: 1024px) {
  #menuToggleBtn { display: flex; }
  /* Desktop nav hidden on mobile */
  #mainNavDesktop {
    display: none !important;
  }
  /* Mobile nav - OUTSIDE header, full screen, no backdrop-filter clipping - v119 fixed header 64px */
  #mainNav {
    display: none;
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    width: 100%;
    height: calc(100dvh - var(--header-h));
    height: -webkit-fill-available;
    min-height: calc(100dvh - var(--header-h));
    max-height: calc(100dvh - var(--header-h));
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 12px 12px 32px;
    gap: 4px;
    background: #0A0A0A;
    background: rgba(10,10,10,.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
    z-index: 1002;
    overflow-y: auto;
    overflow-x: clip;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  #mainNav.open {
    display: flex;
    visibility: visible;
    opacity: 1;
    animation: menuSlideIn .22s ease-out;
  }
  #mainNav a {
    width: 100%;
    height: 48px;
    min-height: 48px;
    padding: 0 16px;
    font-size: .9rem;
    justify-content: flex-start;
    border-radius: 12px;
    flex-shrink: 0;
  }
  .main-nav {
    display: none;
  }
  .main-nav.open {
    display: flex;
  }
  .main-nav a {
    width: 100%;
    height: 48px;
    min-height: 48px;
  }
  /* Ensure overlay covers full screen below header */
  #menuOverlay {
    top: var(--header-h);
    left: 0;
    right: 0;
    width: 100%;
    height: calc(100dvh - var(--header-h));
    background: rgba(0,0,0,.6);
  }
}
@keyframes menuSlideIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* ===== VIEW SECTIONS ===== */
main { position: relative; min-height: 60vh; }
.view-section {
  display: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 0;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  margin: 0;
}
.view-section.active {
  display: block;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  position: relative;
  top: auto; left: auto;
  width: 100%;
  height: auto;
  min-height: 60vh;
  overflow: visible;
  padding: 12px 0 32px;
  animation: viewIn .18s ease-out;
}
@keyframes viewIn { from { opacity: 0; } to { opacity: 1; } }

/* ===== FOOTER ===== */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px 0;
  text-align: center;
  font-size: .82rem;
  color: var(--text-dim);
  background: var(--bg-2);
}

/* ===== SCROLL TOP ===== */
.scroll-top-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 44px; height: 44px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  color: var(--text);
  display: none;
  align-items: center; justify-content: center;
  z-index: 100;
  box-shadow: var(--shadow-md);
  transition: all var(--dur-fast) var(--ease);
}
.scroll-top-btn.visible { display: flex; }
.scroll-top-btn:hover { background: var(--surface-3); border-color: var(--gold-border); color: var(--gold); }

/* FIX v203 - prevent home overflow */
#view-home, #view-market, #view-muta, #view-finance, #view-assistant, #view-news, #view-calendar, #view-chat, #view-account, #view-efile, #view-admin, #view-about, #view-motame {
  max-width: 100%;
  overflow-x: clip;
}
.container {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
  overflow-x: clip;
}
.home-markets-grid-wrapper, #clocksGrid, #summaryGrid, #marketGrid, #forexGrid, #iranAssetsGrid {
  max-width: 100%;
  box-sizing: border-box;
}


/* === 07-mobile.css === */
/* MUTA v200 - 07-mobile.css - ADVANCED MOBILE PWA - PHASE 7 */

/* Mobile-first enhancements */
@media (max-width: 768px) {
  /* Larger touch targets */
  .btn { min-height: 44px; }
  .main-nav a { min-height: 48px; }
  .fm-tab { min-height: 44px; }

  /* Better spacing */
  .container { padding: 0 12px; }
  .view-section.active { padding: 20px 0 80px; }

  /* Bottom navigation for mobile PWA */
  .mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(10,10,10,.98);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 999;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .mobile-bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: .65rem;
    font-weight: 600;
    color: var(--text-dim);
    transition: all .2s;
    flex: 1;
    max-width: 80px;
  }
  .mobile-bottom-nav a.active {
    color: var(--gold);
    background: var(--gold-soft);
  }
  .mobile-bottom-nav a .icon {
    font-size: 1.2rem;
  }
  .mobile-bottom-nav a.active .icon {
    transform: scale(1.1);
  }

  /* Hide desktop nav on mobile when bottom nav exists - but allow open */
  body.pwa-mobile .main-nav {
    display: none;
  }
  body.pwa-mobile .main-nav.open {
    display: flex !important;
  }
  /* v289 FIX: hamburger must be visible in PWA installed version - user reported invisible */
  body.pwa-mobile #menuToggleBtn {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 1005 !important;
  }
  /* When pwa-mobile and menu open, show full screen menu */
  body.pwa-mobile.menu-open-v200-81 .main-nav.open {
    display: flex !important;
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    width: 100%;
    height: calc(100dvh - var(--header-h) - 64px);
    min-height: calc(100dvh - var(--header-h) - 64px);
    z-index: 1002;
    padding-bottom: 80px;
  }

  /* Adjust footer for bottom nav */
  body.pwa-mobile .site-footer {
    padding-bottom: 100px;
  }
  body.pwa-mobile .scroll-top-btn {
    bottom: 80px;
  }
}

/* PWA standalone mode - v289 FIX hamburger visible */
@media (display-mode: standalone) {
  .site-header {
    padding-top: env(safe-area-inset-top);
    height: calc(var(--header-h) + env(safe-area-inset-top));
    z-index: 1003 !important;
  }
  .site-header .header-inner {
    padding-top: env(safe-area-inset-top);
    height: calc(var(--header-h) + env(safe-area-inset-top));
    margin-top: calc(-1 * env(safe-area-inset-top));
  }
  body {
    padding-top: 0;
  }
  body.pwa-standalone {
    padding-top: env(safe-area-inset-top);
  }
  body.pwa-standalone .site-header {
    top: 0;
  }
  #menuToggleBtn {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  .mobile-bottom-nav {
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    height: calc(64px + env(safe-area-inset-bottom));
  }
  /* Hide browser UI elements */
  .pwa-install-prompt {
    display: none !important;
  }
}

/* Offline page */
.offline-page {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
}
.offline-page.visible {
  display: flex;
}
.offline-page .icon {
  font-size: 4rem;
  margin-bottom: 20px;
  opacity: .5;
}
.offline-page h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 12px;
}
.offline-page p {
  color: var(--text-dim);
  max-width: 400px;
  line-height: 1.8;
  margin-bottom: 20px;
}

/* Splash screen */
.pwa-splash {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 1;
  transition: opacity .5s ease;
}
.pwa-splash.hidden {
  opacity: 0;
  pointer-events: none;
}
.pwa-splash .logo {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--gold-soft), var(--purple-soft));
  border: 1px solid var(--gold-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 900;
  color: var(--gold);
  margin-bottom: 20px;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
.pwa-splash .name {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: .05em;
}
.pwa-splash .tag {
  font-size: .8rem;
  color: var(--text-dim);
  margin-top: 4px;
  letter-spacing: .1em;
}

/* Haptic feedback simulation */
.btn:active, .main-nav a:active, .mobile-bottom-nav a:active {
  transform: scale(.96);
}

/* Pull to refresh */
.pull-to-refresh {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  transform: translateY(-100%);
  transition: transform .3s;
  z-index: 998;
}
.pull-to-refresh.visible {
  transform: translateY(0);
}
.pull-to-refresh .spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--line);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* iOS specific */
@supports (-webkit-touch-callout: none) {
  .site-header {
    position: -webkit-sticky;
  }
  /* Fix 100vh on iOS */
  body {
    min-height: -webkit-fill-available;
  }
}


/* === 24-clocks-fix.css === */
/* MUTA v216 - 24-clocks-fix.css - FIX CLOCKS OVERFLOW OUTSIDE FRAME - موتا مارکت + هوشمند INSPIRED */
/* Problem: clocks overflow outside frame due to 4-col grid, fixed 1.6rem time, no min-width:0, settings bar grid-column invalid */

#clocksGrid{
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 14px !important;
  max-width: 100% !important;
  width: 100% !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  padding: 0 !important;
  margin-bottom: 20px !important;
}

#clocksGrid .clock-card,
.clock-card{
  min-width: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  border-radius: 18px !important;
  padding: 16px !important;
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
}

/* Top line and dot - keep inside */
.clock-card .clock-top-line{
  left: 0 !important; right: 0 !important; width: 100% !important; max-width: 100% !important;
}
.clock-card .clock-dot{
  max-width: 8px !important;
}

/* City row - prevent overflow */
.clock-card > div:first-of-type,
.clock-card div[style*="justify-content:space-between"]{
  max-width: 100% !important;
  min-width: 0 !important;
  overflow: hidden !important;
  flex-wrap: nowrap !important;
  gap: 8px !important;
}
.clock-card .city{
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  font-size: 0.92rem !important;
  letter-spacing: -0.015em !important;
  line-height: 1.3 !important;
}

/* Time - responsive clamp like موتا مارکت, prevent overflow */
.clock-card .time,
.clock-card .clock-time,
#clocksGrid .time,
[data-clock-time]{
  font-size: clamp(1.05rem, 2.2vw, 1.35rem) !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em !important;
  line-height: 1.2 !important;
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  direction: ltr !important;
  text-align: left !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  font-variant-numeric: tabular-nums slashed-zero !important;
}

/* Date - small and ellipsis */
.clock-card .date,
[data-clock-date]{
  font-size: 0.72rem !important;
  line-height: 1.4 !important;
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  min-width: 0 !important;
}

/* Progress wrap - full width */
[data-clock-progress-wrap]{
  max-width: 100% !important;
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

/* Status badge - prevent overflow */
.clock-status,
[data-clock-status]{
  max-width: 70px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  font-size: 0.62rem !important;
}

/* Buttons row - wrap properly */
.clock-card div[style*="display:flex"][style*="gap:6px"]{
  max-width: 100% !important;
  min-width: 0 !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
}
.clock-card .btn{
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  font-size: 0.68rem !important;
  height: 30px !important;
  padding: 0 8px !important;
  flex: 1 !important;
}

/* Settings bar - fix grid-column invalid outside grid */
#clocksSettingsBar{
  grid-column: unset !important;
  max-width: 100% !important;
  width: 100% !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  padding: 10px 12px !important;
  border-radius: 14px !important;
  margin-bottom: 12px !important;
}
#clocksSettingsBar span{
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  min-width: 0 !important;
}
#clocksSettingsBar .btn{
  flex-shrink: 0 !important;
  white-space: nowrap !important;
}

/* Responsive - موتا مارکت app style */
@media(max-width:1100px){
  #clocksGrid{ grid-template-columns: repeat(2, minmax(0,1fr)) !important; gap: 12px !important; }
}
@media(max-width:720px){
  #clocksGrid{ grid-template-columns: repeat(2, minmax(0,1fr)) !important; gap: 10px !important; }
  #clocksGrid .clock-card{ padding: 12px !important; border-radius: 14px !important; }
  .clock-card .time, [data-clock-time]{ font-size: clamp(0.95rem, 3.5vw, 1.15rem) !important; }
  .clock-card .city{ font-size: 0.82rem !important; }
  #clocksSettingsBar{ padding: 8px 10px !important; }
}
@media(max-width:480px){
  #clocksGrid{ grid-template-columns: 1fr !important; gap: 10px !important; }
  .clock-card .time, [data-clock-time]{ font-size: 1.25rem !important; }
}


/* === 23-typography-overlap-fix.css === */
/* MUTA v215 - 23-typography-overlap-fix.css - FIX TEXT OVERLAP - موتا مارکت + هوشمند + هوشمند INSPIRED */
/* Problem: -0.045em tracking too tight for Persian causes glyph overlap. Fix: -0.015em max like موتا مارکت, line-height 1.6-1.8, word-wrap */

/* ===== BASE - موتا مارکت: line-height 1.8, letter-spacing -0.01em, word-spacing -0.5px ===== */
html{
  font-size-adjust: none !important; /* Remove 0.52 that causes overlap */
  text-rendering: optimizeLegibility !important;
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
}
body{
  line-height: 1.75 !important;
  letter-spacing: -0.01em !important;
  word-spacing: -0.02em !important;
  overflow-wrap: break-word !important;
  word-break: break-word !important;
}

/* ===== HEADINGS - موتا مارکت: 1.3-1.4 line-height, -0.02em max, not -0.05em ===== */
h1, h2, h3, h4, .section-title, .brand-name, .home-markets-title, .market-card-name, .home-card-name, .mota-card-title, .fm-card-title{
  line-height: 1.35 !important;
  letter-spacing: -0.02em !important;
  word-spacing: -0.01em !important;
  overflow-wrap: break-word !important;
  word-break: break-word !important;
  white-space: normal !important;
}
.section-title{
  font-size: clamp(1.7rem, 3vw, 2.3rem) !important;
  letter-spacing: -0.025em !important;
  line-height: 1.32 !important;
}

/* ===== PRICES - موتا مارکت: 1.2 line-height, -0.02em not -0.045em, prevent overlap ===== */
.home-price, .market-card-price, .fm-kpi-value{
  line-height: 1.25 !important;
  letter-spacing: -0.02em !important;
  word-spacing: 0 !important;
  white-space: nowrap !important; /* Keep price single line like موتا مارکت */
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 100% !important;
}
/* If price wraps (mobile), allow break */
@media(max-width:720px){
  .home-price, .market-card-price{ white-space: normal !important; line-height: 1.3 !important; }
}

/* IRT label - موتا مارکت تومان small */
.home-price .irt, .market-card-price .irt, .irt{
  letter-spacing: -0.005em !important;
  word-spacing: 0 !important;
  white-space: nowrap !important;
}

/* ===== BODY TEXT - هوشمند: 1.8 line-height, 0 tracking ===== */
p, .section-desc, .summary-text, .about-hero p, .news-card p, .calendar-card p, .mota-card-desc, .home-card-symbol, .market-card-symbol{
  line-height: 1.85 !important;
  letter-spacing: -0.008em !important;
  word-spacing: -0.015em !important;
  overflow-wrap: break-word !important;
  word-break: break-word !important;
  white-space: normal !important;
}

/* ===== CARDS - Prevent flex overlap, min-width 0 like موتا مارکت ===== */
.card3d, .clock-card, .summary-card, .home-market-card, .market-card, .mota-card, .fm-card, .fm-kpi{
  overflow-wrap: break-word !important;
  word-break: break-word !important;
  min-width: 0 !important;
}
.card3d *, .clock-card *, .summary-card *, .home-market-card *, .market-card *, .mota-card *{
  min-width: 0 !important;
  overflow-wrap: break-word !important;
}

/* Flex heads - prevent overlap */
.home-card-head, .market-card-head, .summary-headline, .fm-card-head, .home-markets-head, .section-head{
  min-width: 0 !important;
  overflow: hidden !important;
  gap: 10px !important;
}
.home-card-head > div, .market-card-head > div, .summary-headline > div{
  min-width: 0 !important;
  overflow: hidden !important;
}
.home-card-name, .market-card-name, .summary-status{
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  min-width: 0 !important;
  letter-spacing: -0.015em !important;
}
@media(max-width:720px){
  .home-card-name, .market-card-name{ white-space: normal !important; line-height: 1.35 !important; }
}

/* ===== CLOCKS - Prevent time overlap ===== */
.clock-card .time, .clock-card .clock-time{
  letter-spacing: -0.02em !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
.clock-card .city, .clock-card .clock-city, .clock-card .date{
  letter-spacing: -0.01em !important;
  line-height: 1.4 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* ===== SUMMARY META - Prevent badge overlap ===== */
.summary-meta, .home-markets-note, .home-group-title, .meta-up, .meta-down{
  flex-wrap: wrap !important;
  gap: 6px !important;
  min-width: 0 !important;
  overflow-wrap: break-word !important;
  line-height: 1.5 !important;
  letter-spacing: -0.01em !important;
}

/* ===== NAV - Prevent menu overlap ===== */
.main-nav a, .fm-tab, .btn, .brand-name, .brand-tag{
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  letter-spacing: -0.01em !important;
  line-height: 1.3 !important;
}
.main-nav{
  flex-wrap: nowrap !important;
  gap: 4px !important;
}

/* ===== TICKER - Prevent tape overlap ===== */
.tape-track{
  white-space: nowrap !important;
  letter-spacing: -0.005em !important;
  line-height: 36px !important;
  word-spacing: 0 !important;
}

/* ===== FINANCE - Prevent KPI overlap ===== */
.fm-kpi-label{
  letter-spacing: 0.04em !important; /* Uppercase needs looser not tighter */
  line-height: 1.4 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
.fm-kpi-value{
  line-height: 1.15 !important;
  letter-spacing: -0.02em !important;
}

/* ===== CHANGE BADGES - Prevent pill overlap ===== */
.home-change, .market-card-change{
  letter-spacing: -0.005em !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* ===== CONTAINER - Ensure no horizontal overlap ===== */
.container, .view-section, main, .card-grid, .home-markets-grid-wrapper, #clocksGrid, #summaryGrid{
  overflow-x: clip !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* ===== FIX FONT-SIZE-ADJUST ISSUE - Was 0.52 causing overlap ===== */
*{
  font-size-adjust: none !important;
  font-synthesis: none !important;
}

/* ===== موتا مارکت INSPIRED: Word spacing for Persian readability ===== */
body, p, div, span{
  word-spacing: -0.02em;
}
h1, h2, h3, h4{
  word-spacing: -0.03em;
}


/* === 16-home-clean.css === */
/* MUTA v204 - 16-home-clean.css - FIXED HOME NO OVERFLOW */
#view-home.active {
  display: block;
  min-height: 80vh;
  padding: 12px 0 32px;
  background: transparent;
  position: relative;
  max-width: 100%;
  overflow-x: clip;
  box-sizing: border-box;
}
#view-home .section-head { margin-bottom: 12px; max-width: 100%; box-sizing: border-box; }
.home-eyebrow { display:flex; align-items:center; gap:12px; margin-bottom:10px; flex-wrap:wrap; max-width:100%; }
.home-eyebrow-line { width:32px; height:2px; background:linear-gradient(90deg, #D4AF37, transparent); border-radius:999px; display:inline-block; flex-shrink:0; }
.home-live-badge { background:rgba(34,197,94,.10); border:1px solid rgba(34,58,237,.18); color:#22C55E; padding:4px 10px; border-radius:999px; font-size:.68rem; font-weight:800; display:inline-flex; align-items:center; flex-shrink:0; }
#view-home .section-title { font-size:clamp(1.6rem, 3vw, 2.2rem); font-weight:900; letter-spacing:-.04em; line-height:1.15; margin:0; max-width:100%; word-wrap:break-word; }
#view-home .section-desc { font-size:.9rem; color:var(--text-dim); max-width:620px; line-height:1.8; margin-top:8px; word-wrap:break-word; }

/* CLOCKS GRID - SIMPLE NO CONTAIN */
#clocksGrid.home-clocks-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 12px;
  min-height: 100px;
  margin-bottom: 16px;
  max-width: 100%;
  box-sizing: border-box;
}
#clocksGrid .clock-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 90px;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
#clocksGrid .city { font-size:.8rem; font-weight:700; color:var(--text); }
#clocksGrid .time { font-size:1.2rem; font-weight:800; letter-spacing:-.02em; font-variant-numeric:tabular-nums; direction:ltr; text-align:left; }
#clocksGrid .date { font-size:.7rem; color:var(--text-dim); }

/* SUMMARY GRID - SIMPLE */
#summaryGrid.home-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 14px;
  min-height: 180px;
  margin-bottom: 16px;
  max-width: 100%;
  box-sizing: border-box;
}
#summaryGrid .summary-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  min-height: 160px;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
.summary-headline { display:flex; align-items:flex-start; gap:10px; margin-bottom:8px; }
.summary-icon { width:36px; height:36px; border-radius:10px; display:flex; align-items:center; justify-content:center; font-size:1rem; font-weight:800; border:1px solid; flex-shrink:0; }
.summary-status { font-size:.9rem; font-weight:700; color:var(--text); line-height:1.3; }
.summary-sub { font-size:.7rem; color:var(--text-dim); margin-top:2px; }
.summary-text { font-size:.82rem; line-height:1.7; color:var(--text-dim); flex:1; margin:0; overflow:hidden; display:-webkit-box; -webkit-line-clamp:3; line-clamp:3; -webkit-box-orient:vertical; word-wrap:break-word; }
.summary-meta { display:flex; align-items:center; gap:10px; padding-top:8px; border-top:1px dashed var(--line); font-size:.7rem; flex-wrap:wrap; }

/* HOME MARKETS BENTO - SIMPLE */
.home-markets-new { max-width:100%; box-sizing:border-box; overflow-x:clip; }
.home-markets-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; flex-wrap:wrap; gap:8px; max-width:100%; }
.home-markets-title { font-size:1.2rem; font-weight:800; display:flex; align-items:center; gap:8px; margin:0; }
.home-markets-note { font-size:.72rem; color:var(--text-dim); background:var(--surface-2); border:1px solid var(--line); padding:4px 10px; border-radius:999px; max-width:100%; word-wrap:break-word; }
.home-markets-grid-wrapper { display:grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap:14px; max-width:100%; box-sizing:border-box; }
.home-markets-group { max-width:100%; box-sizing:border-box; overflow:hidden; }
.home-group-title { font-size:.9rem; font-weight:700; margin:0 0 10px 0; display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.home-group-grid { display:grid; gap:10px; max-width:100%; box-sizing:border-box; }
.home-market-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  min-height: 120px;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
.home-card-head { display:flex; align-items:center; gap:10px; max-width:100%; }
.home-card-icon { width:36px; height:36px; border-radius:10px; display:flex; align-items:center; justify-content:center; font-weight:700; border:1px solid; flex-shrink:0; }
.home-card-name { font-weight:700; font-size:.85rem; word-wrap:break-word; }
.home-card-symbol { font-size:.7rem; color:var(--text-dim); }
.home-price { font-size:1.2rem; font-weight:800; margin-top:8px; font-variant-numeric: tabular-nums; word-wrap:break-word; }
.home-change { font-size:.72rem; font-weight:600; padding:4px 8px; border-radius:999px; width:fit-content; border:1px solid; display:inline-flex; align-items:center; margin-top:6px; max-width:100%; }

/* TICKER */
.ticker-tape { height:36px; min-height:36px; max-height:36px; overflow:hidden; max-width:100%; }
.tape-track { height:36px; display:flex; align-items:center; }

/* VIEW TRANSITION */
.view-section { overflow-anchor: none; max-width:100%; box-sizing:border-box; }
.view-section.active { animation: viewInOpacityOnly .15s ease-out; }
@keyframes viewInOpacityOnly { from { opacity:0; } to { opacity:1; } }

/* HEADER */
.site-header { height:56px !important; min-height:56px !important; max-height:56px !important; max-width:100%; box-sizing:border-box; }
.header-inner { height:56px !important; min-height:56px !important; max-width:100%; box-sizing:border-box; }
:root { --header-h: 56px !important; }

/* Responsive - SIMPLE */
@media (max-width: 1100px) {
  #clocksGrid.home-clocks-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  #summaryGrid.home-summary-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .home-markets-grid-wrapper { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 720px) {
  #view-home.active { padding: 10px 0 24px; }
  #clocksGrid.home-clocks-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap:8px; }
  #summaryGrid.home-summary-grid { grid-template-columns: 1fr; gap:10px; }
  .home-markets-grid-wrapper { grid-template-columns:1fr; gap:12px; }
  .container { padding: 0 12px; }
}

