/* /economy/ page — builds on styles.css tokens and the shared .mk / .roll / .chip-chg bits */
.econ-body { background: var(--bg); }
.econ-nav a.on { color: var(--accent); font-weight: 800; }
.econ-lang { display: inline-flex; gap: 4px; }
.econ-lang a { padding: 3px 9px; border-radius: 99px; border: 1px solid var(--border); text-decoration: none; color: var(--text-dim); font-size: .8rem; }
.econ-lang a.on { background: var(--green); color: #1B1E15; border-color: transparent; font-weight: 800; }

.econ-hero { padding: 22px 0 6px; background: var(--glow); }
.econ-hero-row { display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap; justify-content: space-between; }
.econ-hero h1 { margin: 6px 0 4px; font-size: clamp(1.4rem, 3.2vw, 2.2rem); font-weight: 800; line-height: 1.35; }
.econ-lede { margin: 0; color: var(--text-dim); font-size: .95rem; }
.econ-status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.econ-stale { margin: 10px 0 0; padding: 8px 12px; border-radius: var(--r-sm); background: var(--live-tint); border: 1px solid var(--live-tint-border); font-size: .85rem; }

.econ-sec { padding-block: 14px; }
.econ-h2 { margin: 0 0 12px; font-size: 1.12rem; font-weight: 800; }
.ec-sub { display: block; color: var(--text-mute); font-size: .8rem; margin: -6px 0 12px; }
.ec-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px 18px; min-width: 0; }
.ec-panel-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.ec-panel-head .econ-h2 { margin: 0; }
.ec-panel-head .ec-sub { margin: 0; flex-basis: 100%; }
.econ-split { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; }

/* the three big cards */
.ec-big { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.ec-card {
  position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 16px 18px 12px; box-shadow: var(--shadow);
  animation: mk-drop .6s cubic-bezier(.2,.8,.2,1) both;
}
.ec-card:nth-child(2) { animation-delay: .08s; } .ec-card:nth-child(3) { animation-delay: .16s; }
.ec-card::before { content: ""; position: absolute; inset-block-start: 0; inset-inline: 0; height: 3px; background: var(--mk-flat); }
.ec-card.tone-bad::before { background: var(--mk-bad); } .ec-card.tone-good::before { background: var(--mk-good); }
.ec-card header { display: flex; align-items: center; gap: 10px; }
.ec-card h3 { margin: 0; font-size: 1rem; font-weight: 800; }
.ec-card h3 small { color: var(--text-mute); font-weight: 600; font-size: .75rem; margin-inline-start: 4px; }
.ec-price { margin-top: 10px; font-size: clamp(1.7rem, 3.4vw, 2.35rem); font-weight: 800; line-height: 1.2; }
.ec-unit { font-size: .8rem; font-weight: 600; color: var(--text-mute); }
.ec-chg { margin-top: 4px; display: flex; align-items: center; gap: 6px; }
.ec-today { font-size: .75rem; color: var(--text-mute); }
.ec-card .ec-spark { display: block; width: 100%; height: 48px; margin-top: 8px; }
.ec-hl { display: flex; gap: 18px; margin: 8px 0 0; font-size: .78rem; color: var(--text-mute); }
.ec-hl div { display: flex; gap: 6px; } .ec-hl dt { margin: 0; } .ec-hl dd { margin: 0; color: var(--text-dim); font-weight: 600; }

/* rows */
.ec-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; }
.ec-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--border-soft);
}
.ec-panel .ec-row { background: transparent; border: 0; border-bottom: 1px solid var(--border-soft); border-radius: 0; padding-inline: 0; }
.ec-panel .ec-row:last-child { border-bottom: 0; }
.ec-name { flex: 1; font-weight: 600; font-size: .92rem; }
.ec-val { font-weight: 800; font-size: 1.02rem; white-space: nowrap; }
.ec-val small { font-weight: 600; font-size: .72rem; color: var(--text-mute); }
.ec-row-big .ec-val { font-size: 1.4rem; }
.ec-ico { width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; display: inline-grid; place-items: center; font-size: .78rem; font-weight: 800; color: #fff; font-family: Arial, sans-serif; }
.ico-gold { background: linear-gradient(135deg, #F3D57A, #B8860B); } .ico-gold::after { content: "Au"; color: #4a3300; font-size: .62rem; }
.ico-btc { background: #F7931A; } .ico-btc::after { content: "\20BF"; }
.ico-eth { background: #627EEA; } .ico-eth::after { content: "\039E"; }
.ico-brent { background: #1B1E15; } .ico-brent::after { content: "\1F6E2"; font-size: .7rem; }
.ico-gas { background: #2563EB; } .ico-gas::after { content: "\1F525"; font-size: .7rem; }

/* tabs + charts */
.ec-tabs { display: inline-flex; gap: 2px; background: var(--inset); border: 1px solid var(--border); border-radius: 99px; padding: 2px; }
.ec-tabs button { border: 0; background: transparent; font: inherit; font-size: .76rem; font-weight: 600; color: var(--text-dim); padding: 4px 11px; border-radius: 99px; cursor: pointer; }
.ec-tabs button.on { background: var(--green); color: #1B1E15; }
.ec-chart { position: relative; margin-top: 8px; }
.ec-chart svg { display: block; width: 100%; height: 240px; touch-action: pan-y; }
.ec-chart-sm svg { height: 160px; }
.ec-chart .ch-grid { stroke: var(--border-soft); stroke-width: 1; vector-effect: non-scaling-stroke; }
.ec-chart .ch-line { fill: none; stroke: var(--mk-flat); stroke-width: 2.4; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.ec-chart .ch-line.draw { stroke-dasharray: 4000; animation: ch-draw 1.3s ease both; }
@keyframes ch-draw { from { stroke-dashoffset: 4000; } to { stroke-dashoffset: 0; } }
.ec-chart .ch-area { fill: var(--mk-flat); opacity: .1; }
.ec-chart .ch-dot { fill: var(--surface); stroke: var(--mk-flat); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.ec-chart .ch-v { stroke: var(--text-mute); stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.ec-chart svg.tone-bad .ch-line, .ec-chart svg.tone-bad .ch-dot { stroke: var(--mk-bad); } .ec-chart svg.tone-bad .ch-area { fill: var(--mk-bad); }
.ec-chart svg.tone-good .ch-line, .ec-chart svg.tone-good .ch-dot { stroke: var(--mk-good); } .ec-chart svg.tone-good .ch-area { fill: var(--mk-good); }
.ec-tip { position: absolute; top: 0; left: 0; width: 120px; pointer-events: none; background: var(--text); color: var(--bg); border-radius: 8px; padding: 6px 9px; font-size: .75rem; text-align: center; box-shadow: var(--shadow); }
.ec-tip b { display: block; font-size: .85rem; } .ec-tip span { opacity: .75; }

/* converter */
.ec-conv { display: grid; gap: 10px; }
.ec-conv label { display: grid; gap: 4px; font-size: .78rem; color: var(--text-mute); }
.ec-conv input, .ec-conv select, .al-form input, .al-form select {
  font: inherit; font-size: .95rem; color: var(--text); background: var(--inset); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 9px 11px; min-width: 0;
}
.ec-conv input { font-size: 1.2rem; font-weight: 800; direction: ltr; text-align: center; }
.ec-swap { justify-self: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: 1rem; transition: transform .3s; color: var(--text); }
.ec-swap.on { transform: rotate(180deg); background: var(--green); }
.ec-conv-out { margin: 0; padding: 12px; border-radius: var(--r); background: var(--chip-fill); border: 1px solid var(--chip-border); text-align: center; }
.ec-conv-out span { display: block; font-size: .75rem; color: var(--text-mute); }
.ec-conv-out b { font-size: 1.35rem; font-weight: 800; }

/* market desk notes */
.ec-notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.ec-notes li { padding: 10px 12px; border-radius: var(--r-sm); background: var(--inset); font-size: .9rem; line-height: 1.75; border-inline-start: 3px solid var(--mk-flat); }
.ec-notes li.tone-bad { border-inline-start-color: var(--mk-bad); }
.ec-notes li.tone-good { border-inline-start-color: var(--mk-good); }

/* alerts */
.al-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.al-form input { width: 150px; direction: ltr; text-align: center; font-weight: 800; }
.al-form small { color: var(--text-mute); }
.al-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.al-list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 12px; border-radius: var(--r-sm); background: var(--inset); font-size: .88rem; }
.al-list li.fired { background: var(--chip-fill); border: 1px solid var(--chip-border); }
.al-list .al-txt { flex: 1; font-weight: 600; }
.al-list .al-now { color: var(--text-mute); font-size: .8rem; }
.al-list .al-act { display: flex; gap: 6px; }
.al-list button { font: inherit; font-size: .75rem; border: 1px solid var(--border); background: var(--surface); color: var(--text-dim); border-radius: 99px; padding: 3px 10px; cursor: pointer; }
.al-empty { color: var(--text-mute); }
.ec-fine { margin: 10px 0 0; font-size: .74rem; color: var(--text-mute); line-height: 1.7; }
.al-toast {
  position: fixed; inset-inline: 16px; bottom: 18px; z-index: 90; max-width: 460px; margin-inline: auto;
  background: var(--text); color: var(--bg); padding: 14px 16px; border-radius: var(--r); box-shadow: var(--shadow);
  white-space: pre-line; font-weight: 600; animation: fp-in-up .4s ease both;
}

/* Iranians in the world */
.ds-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ds-stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px; display: grid; gap: 2px; }
.ds-stat b { font-size: 1.6rem; font-weight: 800; color: var(--green-ink); }
:root[data-theme="dark"] .ds-stat b { color: var(--green); }
.ds-stat span { font-weight: 600; font-size: .88rem; }
.ds-stat small { color: var(--text-mute); font-size: .72rem; }
.ds-h3 { margin: 20px 0 10px; font-size: 1rem; font-weight: 800; }
.ds-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ds-bars li { display: grid; grid-template-columns: 170px minmax(0, 1fr) 48px; align-items: center; gap: 10px; }
.ds-name { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .9rem; }
.ds-name .flag { width: 24px; height: 24px; font-size: .55rem; }
.ds-name .flag::after { content: attr(data-c); color: #fff; font-size: .55rem; }
.ds-bar { height: 14px; background: var(--inset); border-radius: 99px; overflow: hidden; }
.ds-bar i { display: block; height: 100%; width: var(--w); border-radius: 99px; background: linear-gradient(90deg, var(--green-deep), var(--green)); transform-origin: inline-start; animation: ds-grow 1.1s cubic-bezier(.2,.8,.2,1) both; }
@keyframes ds-grow { from { transform: scaleX(0); } }
.ds-pct { font-weight: 800; font-size: .92rem; }
.ds-cnt { grid-column: 2 / 4; margin-top: -6px; color: var(--text-mute); font-size: .74rem; }

/* FAQ */
.ec-faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 12px 14px; margin-bottom: 8px; }
.ec-faq summary { cursor: pointer; font-weight: 700; }
.ec-faq details p { margin: 8px 0 0; color: var(--text-dim); line-height: 1.8; }

@media (max-width: 960px) {
  .econ-split { grid-template-columns: 1fr; }
  .ec-big { grid-template-columns: 1fr; }
  .ec-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .econ-nav { display: none; }
  .ds-stats { grid-template-columns: 1fr; }
  .ds-bars li { grid-template-columns: 112px minmax(0, 1fr) 40px; }
  .ec-chart svg { height: 200px; }
  .al-form input { width: 120px; }
}
@media (prefers-reduced-motion: reduce) { .ec-card, .ds-bar i, .al-toast { animation: none !important; } }
