/* atropi-scope: .ec- */
/* =====================================================================================================
   ATROPI — Economic Calendar (page-templates/economic-calendar.php). Loaded only on that template, after
   _components.css. Every selector is under the .ec- prefix (declared above) or a section id.
   1. shared bits (flags, impact dots)  2. hero visual: event timeline (LTR island, never mirrored)
   3. live TradingView frame  4. why (time rail)  5. how to use (time horizons)  6. responsive  7. reduced motion
   Tokens only; Day + Night designed separately. RTL twin generated by tools/build.mjs.
   ===================================================================================================== */

/* ---------------------------------------------------------------- 1. shared bits */
.ec-flag { position: relative; display: inline-block; flex: none; width: 18px; height: 18px; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 1.5px var(--surface), 0 1px 3px rgba(10, 22, 40, .18); background: var(--surface-3); }
.ec-flag svg { display: block; width: 100%; height: 100%; }
:root[data-theme="dark"] .ec-flag { box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .10), 0 1px 3px rgba(0, 0, 0, .5); }

.ec-imp { display: inline-flex; align-items: center; gap: 2.5px; flex: none; }
.ec-imp i { width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); transition: background-color .4s var(--ease-out), transform .4s var(--ease-out); }
.ec-imp[data-imp="3"] i { background: var(--bear-vivid); }
.ec-imp[data-imp="2"] i:nth-child(-n+2) { background: var(--gold); }
.ec-imp[data-imp="1"] i:first-child { background: var(--brand-400); }

/* answer-first facts: 2 × 2 (word values like "Real-time" / "TradingView" need the width) */
.ec-facts .ac-fact:nth-child(2n + 1) { border-inline-start: 0; }
.ec-facts .ac-fact:nth-child(n + 3) { border-top: 1px solid var(--line); }
.ec-facts .ac-fact-t { min-height: 0; }
.ec-facts .ac-fact-v .num { overflow-wrap: normal; }

/* ---------------------------------------------------------------- 2. HERO VISUAL — event timeline */
/*rtl:begin:ignore*/
.ec-tl {
  --ec-card-bg: rgba(255, 255, 255, .80);
  --ec-card-border: rgba(255, 255, 255, .95);
  --ec-card-ring: rgba(17, 103, 235, .10);
  --ec-card-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 0 0 1px var(--ec-card-ring), 0 60px 110px -40px rgba(17, 52, 120, .34), 0 24px 44px -24px rgba(10, 22, 40, .16);
  --ec-stage-bg: linear-gradient(180deg, rgba(238, 244, 255, .7), rgba(248, 250, 253, .5));
  --ec-lane: 38px;
  --ec-tx: 0; --ec-ty: 0;
  position: relative; width: 100%; max-width: 560px; margin-inline: auto;
  perspective: 1400px; direction: ltr; text-align: left;
}
:root[data-theme="dark"] .ec-tl {
  --ec-card-bg: rgba(43, 12, 57, .72);
  --ec-card-border: rgba(200, 180, 213, .14);
  --ec-card-ring: rgba(153, 117, 176, .14);
  --ec-card-shadow: 0 1px 0 rgba(255, 255, 255, .07) inset, 0 0 0 1px var(--ec-card-ring), 0 50px 130px -40px rgba(85, 25, 124, .42), 0 30px 60px -30px rgba(0, 0, 0, .8);
  --ec-stage-bg: linear-gradient(180deg, rgba(153, 117, 176, .07), rgba(45, 12, 60, .2));
}
.ec-tl-tilt { transform: rotateX(calc(var(--ec-ty) * -3deg)) rotateY(calc(var(--ec-tx) * 4deg)); transform-origin: 50% 50%; transition: transform .7s var(--ease-out); will-change: transform; }
.ec-tl-card {
  position: relative; overflow: hidden;
  padding: 18px 18px 14px;
  border-radius: 22px;
  background: var(--ec-card-bg);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid var(--ec-card-border);
  box-shadow: var(--ec-card-shadow);
}
.ec-tl-glare { position: absolute; inset: 0; z-index: 3; pointer-events: none; border-radius: inherit; background: radial-gradient(520px circle at calc(50% + var(--ec-tx) * 45%) calc(30% + var(--ec-ty) * 50%), rgba(255, 255, 255, .45), rgba(255, 255, 255, 0) 45%); mix-blend-mode: soft-light; }
:root[data-theme="dark"] .ec-tl-glare { background: radial-gradient(520px circle at calc(50% + var(--ec-tx) * 45%) calc(30% + var(--ec-ty) * 50%), rgba(187, 163, 203, .12), rgba(187, 163, 203, 0) 50%); mix-blend-mode: normal; }

/* head */
.ec-tl-head { display: flex; align-items: center; gap: 12px; }
.ec-tl-ico { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 11px; background: var(--brand-50); color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand-100); }
.ec-tl-ttl { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.ec-tl-ttl b { font-size: 15px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }
.ec-tl-ttl > span { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.ec-tl-tz { font-size: 10.5px; letter-spacing: .04em; }
.ec-tl-badge { margin-left: auto; padding: 4px 9px; border-radius: 7px; border: 1px dashed var(--line-strong); font-size: 9.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }

.ec-tl-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; margin-top: 14px; font-size: 11px; color: var(--muted); }
.ec-tl-legend-k { font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.ec-tl-legend-i { display: inline-flex; align-items: center; gap: 6px; }

/* stage: lanes over a time axis, "Now" at one third */
.ec-tl-stage {
  position: relative; margin-top: 12px;
  height: calc(28px + var(--ec-lane) * 3 + 30px);
  border-radius: 14px;
  background: var(--ec-stage-bg);
  box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden;
}
.ec-tl-stage::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: calc(100% / 12) 100%; opacity: .9; pointer-events: none; }
.ec-tl-lanes, .ec-tl-axis {
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 9%, #000 91%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 9%, #000 91%, transparent 100%);
}
.ec-tl-lanes { position: absolute; left: 0; right: 0; top: 30px; bottom: 30px; z-index: 2; }
.ec-ev { position: absolute; left: var(--x0); top: calc(var(--lane) * var(--ec-lane)); height: 30px; display: flex; align-items: center; white-space: nowrap; will-change: transform; transition: opacity .6s var(--ease-out); }
.ec-tl.is-live .ec-ev { left: 0; }
.ec-ev-pin { position: absolute; left: 0; top: 15px; width: 1px; height: calc((3 - var(--lane)) * var(--ec-lane) - 15px + 6px); background: repeating-linear-gradient(180deg, var(--line-strong) 0 3px, transparent 3px 6px); }
.ec-ev-pin::after { content: ""; position: absolute; left: -3px; bottom: -3px; width: 7px; height: 7px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.ec-ev-in {
  position: relative; display: inline-flex; align-items: center; gap: 7px;
  height: 30px; padding: 0 11px 0 9px; margin-left: -9px;
  border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  font-size: 12px; color: var(--text);
  transition: background-color .5s var(--ease-out), border-color .5s, box-shadow .5s, opacity .5s;
}
:root[data-theme="dark"] .ec-ev-in { background: var(--surface-2); border-color: rgba(255, 255, 255, .08); }
.ec-ev-time { font-size: 10.5px; font-weight: 500; color: var(--muted); }
.ec-ev .ec-flag { width: 16px; height: 16px; }
.ec-ev-cur { font-size: 11px; font-weight: 700; color: var(--ink); letter-spacing: .02em; }
.ec-ev-name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; font-weight: 500; color: var(--ink); }
.ec-ev.is-past .ec-ev-in { opacity: .58; box-shadow: none; }
.ec-ev.is-past .ec-ev-pin::after { background: var(--muted); box-shadow: none; }
.ec-ev.is-next .ec-ev-in { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.ec-ev.is-hot .ec-ev-in { opacity: 1; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100), var(--shadow-sm); }
.ec-ev.is-hot .ec-ev-pin::after { background: var(--brand); box-shadow: 0 0 0 4px var(--brand-100); }

.ec-tl-now { position: absolute; top: 0; bottom: 30px; left: 33.333%; width: 0; z-index: 1; pointer-events: none; }
.ec-tl-now i { position: absolute; left: -1px; top: 22px; bottom: -4px; width: 2px; border-radius: 2px; background: linear-gradient(180deg, var(--brand), color-mix(in srgb, var(--brand) 30%, transparent)); box-shadow: 0 0 12px var(--brand-glow); }
.ec-tl-now-l { position: absolute; top: 5px; left: 0; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 9.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; box-shadow: 0 6px 16px -6px var(--brand-glow); }
.ec-tl-now-l b { font-weight: 600; letter-spacing: .02em; }

.ec-tl-axis { position: absolute; left: 0; right: 0; bottom: 0; height: 30px; border-top: 1px solid var(--line); }
.ec-tl-tick { position: absolute; top: 0; left: var(--x0); will-change: transform; }
.ec-tl.is-live .ec-tl-tick { left: 0; }
.ec-tl-tick i { position: absolute; left: 0; top: 0; width: 1px; height: 5px; background: var(--line-strong); }
.ec-tl-tick b { position: absolute; top: 9px; left: 0; transform: translateX(-50%); font-size: 10px; font-weight: 500; color: var(--muted); }

/* focus card: the release */
.ec-tl-focus { --ec-tone: var(--ink); margin-top: 12px; padding: 14px 14px 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
:root[data-theme="dark"] .ec-tl-focus { background: rgba(255, 255, 255, .03); border-color: rgba(255, 255, 255, .08); }
.ec-tl-focus[data-tone="up"] { --ec-tone: var(--bull); }
.ec-tl-focus[data-tone="down"] { --ec-tone: var(--bear); }
.ec-tl-fhead { display: flex; align-items: center; gap: 10px; }
.ec-tl-fflag .ec-flag { width: 26px; height: 26px; }
.ec-tl-ftxt { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.ec-tl-fname { font-size: 14.5px; font-weight: 650; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ec-tl-fmeta { font-size: 10.5px; color: var(--muted); letter-spacing: .02em; }
.ec-tl-fstate { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 999px; background: var(--bull-bg); color: var(--bull); font-size: 9.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; }
.ec-tl-fstate i { width: 6px; height: 6px; border-radius: 50%; background: var(--bull-vivid); }
.ec-tl-figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.25fr); gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.ec-tl-fig { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ec-tl-fk { font-size: 9.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.ec-tl-fv { display: inline-block; align-self: flex-start; font-size: 20px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; color: var(--ink); border-radius: 6px; }
.ec-tl-fig.is-a .ec-tl-fv { color: var(--ec-tone); }
.ec-tl-react { display: block; width: 100%; height: 26px; overflow: visible; }
.ec-tl-react-base { fill: none; stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 2 3; vector-effect: non-scaling-stroke; }
.ec-tl-react-line { fill: none; stroke: var(--brand); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.ec-tl.is-live .ec-tl-react-line { transition: stroke-dashoffset 1.4s var(--ease-out); }
.ec-tl.is-live .ec-tl-focus.is-pre .ec-tl-react-line { stroke-dashoffset: 1; transition: none; }
.ec-tl.is-live .ec-tl-focus .ec-tl-fv, .ec-tl.is-live .ec-tl-focus .ec-tl-fname { transition: opacity .5s var(--ease-out), transform .6s var(--ease-out); }
.ec-tl.is-live .ec-tl-focus.is-pre .ec-tl-fv, .ec-tl.is-live .ec-tl-focus.is-pre .ec-tl-fname { opacity: 0; transform: translateY(6px); transition: none; }

/* foot: next release + illustrative note */
.ec-tl-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; }
.ec-tl-next { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-size: 11px; color: var(--text); }
.ec-tl-next-k { font-size: 9.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.ec-tl-next .ec-flag { width: 14px; height: 14px; }
.ec-tl-next-cur { font-weight: 700; color: var(--ink); }
.ec-tl-next-name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-sans); font-size: 11.5px; }
.ec-tl-next-in { padding: 2px 6px; border-radius: 5px; background: var(--brand-50); color: var(--brand-ink); font-weight: 600; }
.ec-tl-note { font-size: 10.5px; color: var(--muted); }

/* entrance (the hero visual itself scales in; pills arrive after) */
html.js .ac-hero-visual.is-in .ec-tl.is-live .ec-ev-in { animation: ec-pill-in .9s var(--ease-out) both; animation-delay: calc(.35s + var(--lane) * .08s); }
@keyframes ec-pill-in { from { opacity: 0; transform: translateY(8px) scale(.96); } }
/*rtl:end:ignore*/

/* fa / ar: word values (facts strip, hero proof) read in the sans face — mono has no Arabic script */
html[dir="rtl"] .ec-facts .ac-fact-v .num, html[dir="rtl"] .ec-hero .ac-hero-proof b { font-family: var(--font-sans); letter-spacing: 0; font-weight: 700; }

/* Persian / Arabic: never track or uppercase Arabic script inside the island */
html[dir="rtl"] .ec-tl-badge, html[dir="rtl"] .ec-tl-legend-k, html[dir="rtl"] .ec-tl-now-l span, html[dir="rtl"] .ec-tl-fk, html[dir="rtl"] .ec-tl-fstate, html[dir="rtl"] .ec-tl-next-k { font-family: var(--font-sans); letter-spacing: 0; text-transform: none; font-size: 11px; }
html[dir="rtl"] .ec-tl-ttl > span, html[dir="rtl"] .ec-tl-note { font-family: var(--font-sans); }
html[dir="rtl"] .ec-ev-name, html[dir="rtl"] .ec-tl-fname, html[dir="rtl"] .ec-tl-next-name { font-family: var(--font-sans); }

/* ---------------------------------------------------------------- 3. LIVE CALENDAR FRAME (TradingView) */
#calendar .chapter-head { margin-inline: auto; }
.ec-frame-wrap { position: relative; margin-top: clamp(36px, 4.5vw, 64px); }
.ec-frame-wrap::before { content: ""; position: absolute; inset: -12% -6% auto; height: 70%; z-index: -1; background: radial-gradient(60% 60% at 50% 40%, var(--field-a), transparent 70%); pointer-events: none; }
.ec-frame {
  --ec-body-h: 600px;
  position: relative;
  padding: 10px;
  border-radius: 26px;
  background: var(--surface-glass);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg), inset 0 1px 0 var(--glass-hi);
}
.ec-frame-crop { position: absolute; width: 18px; height: 18px; pointer-events: none; border-color: var(--line-strong); border-style: solid; border-width: 0; }
.ec-frame-crop.is-tl { top: -12px; left: -12px; border-top-width: 1px; border-left-width: 1px; }
.ec-frame-crop.is-tr { top: -12px; right: -12px; border-top-width: 1px; border-right-width: 1px; }
.ec-frame-crop.is-bl { bottom: -12px; left: -12px; border-bottom-width: 1px; border-left-width: 1px; }
.ec-frame-crop.is-br { bottom: -12px; right: -12px; border-bottom-width: 1px; border-right-width: 1px; }

.ec-frame-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 28px; padding: 10px 12px 14px; }
.ec-frame-id { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin: 0; }
.ec-frame-id b { font-size: 16px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }
.ec-frame-live { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px 5px 9px; border-radius: 999px; background: var(--bull-bg); color: var(--bull); font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.ec-frame-live .pill-dot { width: 7px; height: 7px; }
.ec-frame-src { font-size: 11.5px; color: var(--muted); letter-spacing: .02em; }
.ec-frame-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 22px; min-width: 0; }
.ec-ff { display: flex; align-items: center; gap: 8px; margin: 0; min-width: 0; }
.ec-ff-k { font-size: 9.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.ec-ff-chip, .ec-ff-cur { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 12px; color: var(--text); white-space: nowrap; }
:root[data-theme="dark"] .ec-ff-chip, :root[data-theme="dark"] .ec-ff-cur { background: rgba(255, 255, 255, .04); }
.ec-ff-curs { display: flex; gap: 4px; min-width: 0; }
.ec-ff-cur { padding: 0 8px 0 5px; gap: 5px; }
.ec-ff-cur .mono { font-size: 11px; font-weight: 600; color: var(--ink); }
.ec-ff-cur .ec-flag { width: 16px; height: 16px; }

.ec-frame-body {
  position: relative; overflow: hidden;
  height: var(--ec-body-h);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}
:root[data-theme="dark"] .ec-frame-body { background: var(--surface); }
.ec-tv { position: absolute; inset: 0; opacity: 0; transition: opacity .6s var(--ease-out) .1s; }
.ec-tv iframe { display: block; width: 100%; height: 100%; border: 0; color-scheme: normal; } /* same scheme as the widget document → transparent iframe (no opaque UA backdrop in Night) */
.ec-tv .tradingview-widget-copyright { display: none; }
.ec-frame.is-loaded .ec-tv { opacity: 1; }

/* skeleton (until the widget iframe has loaded) */
.ec-skel { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 8px 18px; transition: opacity .5s var(--ease-out), visibility 0s linear .5s; }
.ec-frame.is-loaded .ec-skel, .ec-frame.is-error .ec-skel { opacity: 0; visibility: hidden; }
.ec-skel-row { display: grid; grid-template-columns: 54px 22px 44px minmax(0, 1fr) 30px 54px 54px 54px; align-items: center; gap: 14px; height: 58px; border-bottom: 1px solid var(--line); }
.ec-skel-row i { display: block; height: 9px; border-radius: 5px; background: linear-gradient(90deg, var(--surface-3) 0%, var(--surface-2) 45%, var(--surface-3) 90%); background-size: 220% 100%; animation: ec-shimmer 1.8s linear infinite; animation-delay: var(--d, 0ms); }
:root[data-theme="dark"] .ec-skel-row i { background-image: linear-gradient(90deg, rgba(255, 255, 255, .05) 0%, rgba(255, 255, 255, .10) 45%, rgba(255, 255, 255, .05) 90%); }
.ec-skel-row .is-f { width: 22px; height: 22px; border-radius: 50%; }
.ec-skel-row .is-n { width: var(--w); }
.ec-skel-row .is-i { width: 26px; }
.ec-skel-row.is-day { grid-template-columns: 160px; height: 46px; }
.ec-skel-row.is-day i:not(:first-child) { display: none; }
.ec-skel-row.is-day i:first-child { width: 160px; height: 11px; }
.ec-skel-msg { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); font-size: 11px; color: var(--muted); white-space: nowrap; }
@keyframes ec-shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }

.ec-frame-err { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; text-align: center; }
.ec-frame-err[hidden] { display: none; }
.ec-frame-err p { max-width: 420px; color: var(--text); font-size: 15px; }
.ec-frame-err-ico { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--brand-50); color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand-100); }
.ec-frame-err-act { display: flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 16px; }
.ec-frame-nojs { position: absolute; inset: auto 0 0; padding: 18px; text-align: center; font-size: 14px; color: var(--text); background: var(--surface); }

.ec-frame-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 20px; padding: 12px 12px 4px; font-size: 12.5px; color: var(--muted); }
.ec-frame-credit { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.ec-frame-credit a { color: var(--brand-ink); text-decoration: none; font-weight: 600; letter-spacing: .06em; text-transform: none; font-size: 11.5px; }
.ec-frame-credit a:hover { text-decoration: underline; }

html[dir="rtl"] .ec-frame-live .mono, html[dir="rtl"] .ec-ff-k, html[dir="rtl"] .ec-frame-credit, html[dir="rtl"] .ec-skel-msg { font-family: var(--font-sans); letter-spacing: 0; text-transform: none; font-size: 12px; }

/* ---------------------------------------------------------------- 4. WHY — four rows on a time rail */
.ec-why { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr); grid-template-areas: "copy side" "cta side"; column-gap: clamp(40px, 6vw, 104px); row-gap: 0; }
.ec-why-copy { grid-area: copy; align-self: end; }
.ec-why-side { grid-area: side; align-self: center; }
.ec-why-copy .chapter-head { margin-bottom: 0; }
.ec-why-actions { grid-area: cta; align-self: start; margin-top: clamp(26px, 3vw, 36px); }
.ec-why-intro { display: flex; align-items: center; gap: 12px; margin: 6px 0 22px; font-size: 16px; font-weight: 600; color: var(--ink); }
.ec-why-intro-dot { width: 9px; height: 9px; flex: none; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 5px var(--brand-100); }
.ec-why-track { position: relative; }
.ec-why-rail { position: absolute; inset-inline-start: 11px; top: 26px; bottom: 26px; width: 2px; border-radius: 2px; background: var(--line-strong); overflow: hidden; }
.ec-why-rail-fill { position: absolute; inset: 0; background: linear-gradient(180deg, var(--brand-400), var(--brand)); transform-origin: 50% 0; transform: scaleY(var(--p, 1)); }
.ec-why-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.ec-why-li { position: relative; padding-inline-start: 40px; }
.ec-why-node { position: absolute; inset-inline-start: 4px; top: 50%; width: 16px; height: 16px; margin-top: -8px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 2px var(--line-strong); transition: box-shadow .5s var(--ease-out); }
.ec-why-node span { position: absolute; inset: 4px; border-radius: 50%; background: var(--brand); transform: scale(0); transition: transform .5s var(--ease-spring); }
.ec-why-li.is-on .ec-why-node { box-shadow: inset 0 0 0 2px var(--brand), 0 0 0 5px var(--brand-100); }
.ec-why-li.is-on .ec-why-node span { transform: scale(1); }
.ec-why-row {
  position: relative; display: flex; align-items: center; gap: 16px;
  min-height: 96px; padding: 18px 22px;
  border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  transition: transform .55s var(--ease-out), box-shadow .55s var(--ease-out), border-color .3s;
}
.ec-why-row:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.ec-why-n { font-size: 12px; font-weight: 600; color: var(--muted); flex: none; }
.ec-why-ico { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 13px; background: var(--brand-50); color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand-100); transition: background .4s var(--ease-out), color .4s; }
.ec-why-row:hover .ec-why-ico { background: var(--btn-bg); color: #fff; }
.ec-why-t { flex: 1; min-width: 0; font-size: clamp(16px, 1.2vw, 18px); line-height: 1.4; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
.ec-why-imp i { background: var(--line-strong); }
html.js .ec-why-li .ec-why-imp i { transition: background-color .35s var(--ease-out); }
.ec-why-li.is-in .ec-why-imp i { background: var(--bear-vivid); }
.ec-why-li.is-in .ec-why-imp i:nth-child(1) { transition-delay: .45s; }
.ec-why-li.is-in .ec-why-imp i:nth-child(2) { transition-delay: .6s; }
.ec-why-li.is-in .ec-why-imp i:nth-child(3) { transition-delay: .75s; }

/* ---------------------------------------------------------------- 5. HOW TO USE — time horizons */
#use .ac-feat { gap: 18px; }
#use .ac-feat-visual { margin-top: auto; }
/*rtl:begin:ignore*/
.ec-hz { --ec-pad: clamp(22px, 2.2vw, 30px); position: relative; padding: 30px var(--ec-pad) 20px; border-top: 1px solid var(--line); background: linear-gradient(180deg, var(--surface-2), var(--surface)); direction: ltr; }
:root[data-theme="dark"] .ec-hz { background: linear-gradient(180deg, rgba(255, 255, 255, .025), rgba(255, 255, 255, 0)); }
.ec-hz-svg { display: block; width: 100%; height: 72px; overflow: visible; color: var(--brand); }
.ec-hz-band { fill: var(--brand-50); }
.ec-hz-line { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; } /* no non-scaling-stroke: it breaks pathLength dashes on a stretched viewBox */
html.js .ac-feats-i:not(.is-in) .ec-hz-line { stroke-dashoffset: 1; }
html.js .ec-hz-line { transition: stroke-dashoffset 1.8s var(--ease-io) .3s; }
.ec-hz-ev { stroke: var(--bear-vivid); stroke-width: 1.2; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; opacity: .7; }
.ec-hz-pin { position: absolute; top: 12px; left: calc(var(--ec-pad) + (100% - 2 * var(--ec-pad)) * var(--xn)); transform: translateX(-50%); display: inline-flex; padding: 4px 6px; border-radius: 999px; background: var(--surface); box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); }
html.js .ac-feats-i:not(.is-in) .ec-hz-pin { opacity: 0; transform: translate(-50%, 6px); }
html.js .ec-hz-pin { transition: opacity .6s var(--ease-out) 1.2s, transform .6s var(--ease-out) 1.2s; }
.ec-hz-axis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin-top: 10px; }
.ec-hz-seg { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ec-hz-seg i { height: 3px; border-radius: 3px; background: var(--line-strong); }
.ec-hz-seg b { font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ec-hz-seg.is-on i { background: var(--brand); }
.ec-hz-seg.is-on b { color: var(--brand-ink); }
/*rtl:end:ignore*/
html[dir="rtl"] .ec-hz-seg b { font-family: var(--font-sans); letter-spacing: 0; text-transform: none; font-size: 11.5px; }

/* ---------------------------------------------------------------- 6. RESPONSIVE */
@media (max-width: 1099px) {
  .ec-why { grid-template-columns: minmax(0, 1fr); grid-template-areas: "copy" "side" "cta"; row-gap: clamp(36px, 6vw, 56px); }
  .ec-why-actions { margin-top: 0; }
}
@media (max-width: 900px) {
  .ec-frame-bar { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 760px) {
  .ec-frame { padding: 6px; border-radius: 20px; }
  .ec-frame-crop { display: none; }
  .ec-frame-body { border-radius: 14px; }
  .ec-frame-filters { width: 100%; }
  .ec-ff { width: 100%; flex-wrap: wrap; row-gap: 6px; }
  .ec-ff-k { width: 100%; }
  .ec-ff-chip { height: 26px; padding: 0 9px; font-size: 11.5px; }
  /*rtl:ignore*/
  .ec-ff-curs { overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); padding-right: 24px; }
  .ec-ff-curs::-webkit-scrollbar { display: none; }
  .ec-skel { padding: 4px 12px; }
  .ec-skel-row { grid-template-columns: 44px 20px minmax(0, 1fr) 26px; gap: 10px; }
  .ec-skel-row .is-v { display: none; }
}
/*rtl:begin:ignore*/
@media (max-width: 560px) {
  .ec-tl { --ec-lane: 34px; }
  .ec-tl-card { padding: 14px 12px 12px; border-radius: 18px; }
  .ec-tl-ttl > span { display: none; }
  .ec-tl-legend { margin-top: 10px; }
  .ec-ev-time { display: none; }
  .ec-ev-in { gap: 6px; padding-right: 9px; font-size: 11.5px; }
  .ec-ev-name { max-width: 104px; }
  .ec-tl-figs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ec-tl-fig.is-react { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 10px; }
  .ec-tl-fig.is-react .ec-tl-react { flex: 1; }
  .ec-tl-fv { font-size: 17px; }
  .ec-tl-note { width: 100%; }
}
/*rtl:end:ignore*/
@media (max-width: 480px) {
  .ec-frame-src { display: none; }
  .ec-why-row { gap: 12px; padding: 14px 14px; }
  .ec-why-n { display: none; }
  .ec-why-ico { width: 40px; height: 40px; }
}

/* ---------------------------------------------------------------- 7. REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
  .ec-skel-row i { animation: none; }
  .ec-tl-tilt { transform: none; }
}
html.reduced .ec-skel-row i { animation: none; }
html.reduced .ec-tl-tilt { transform: none; }

/* ---------------------------------------------------------------- 8. RTL separators (fa · ar) */
/* "· GMT" / "· TradingView" are LTR mono runs that start with the separator: in a Persian/Arabic sentence the run
   takes the sentence direction so the "·" sits between the RTL text and the Latin word (not after the word). */
/*rtl:ignore*/
html[dir="rtl"] .ec-tl .ec-tl-tz, html[dir="rtl"] .ec-frame .ec-frame-src { direction: rtl; } /* beats base [dir="rtl"] :is(.mono …) (0,2,2) */

/* ---------------------------------------------------------------- 9. RUSSIAN (ru localisation) */
/* "Экономический календарь" (23 letters, mono caps + tracking) is wider than the shared 24ch phone cap on the current
   breadcrumb and got an ellipsis on its own line; the trail already wraps, so let the last crumb use the full row. */
@media (max-width: 640px) {
  html[lang^="ru"] .ec-hero .ac-crumb-cur { max-width: 100%; }
}
