/* ExpertPulse — Markets board (trending pages, [ep_markets]). Uses the site's own tokens. */
.ep-mkts { margin: 0 0 32px; padding: 18px 20px 14px; border: 1px solid var(--border, rgba(127,127,127,.2)); border-radius: var(--radius, 10px); background: var(--bg-card, transparent); }
.ep-mkts__top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 12px; }
.ep-mkts__title { margin: 0; font-size: 1.1rem; font-weight: 800; letter-spacing: -.01em; display: inline-flex; align-items: center; gap: 8px; }
.ep-mkts__title::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.ep-mkts__meta { font-size: .8rem; color: var(--text-muted, var(--text-light, #6b7280)); }
.ep-mkts__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px 28px; }
.ep-mkts__h { display: flex; align-items: center; gap: 6px; margin: 0 0 4px; padding: 0 0 8px; border-bottom: 2px solid var(--text-main, currentColor); font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.ep-mkts__h i { color: var(--accent-text, var(--accent)); font-size: 1rem; }
.ep-mkts ul { list-style: none; margin: 0; padding: 0; }
.ep-mkts li { display: grid; grid-template-columns: minmax(0, 1fr) auto 74px; align-items: baseline; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border, rgba(127,127,127,.18)); font-size: .9rem; font-variant-numeric: tabular-nums; }
.ep-mkts li:last-child { border-bottom: 0; }
.ep-mkts__name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ep-mkts__name em { font-style: normal; font-weight: 500; font-size: .78em; color: var(--text-muted, var(--text-light, #6b7280)); margin-left: 2px; }
.ep-mkts__price { font-weight: 600; text-align: right; }
.ep-mkts .ep-mkt__c { justify-self: end; font-size: .78rem; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: color-mix(in srgb, currentColor 10%, transparent); color: var(--text-muted, var(--text-light, #6b7280)); white-space: nowrap; }
.ep-mkts .ep-mkt__c.is-up { color: #15803d; }
.ep-mkts .ep-mkt__c.is-down { color: #be123c; }
html[data-theme="dark"] .ep-mkts .ep-mkt__c.is-up { color: #4ade80; }
html[data-theme="dark"] .ep-mkts .ep-mkt__c.is-down { color: #fb7185; }
.ep-mkts__empty { margin: 8px 0; color: var(--text-muted, var(--text-light, #6b7280)); font-size: .9rem; }
.ep-mkts__src { margin: 10px 0 0; font-size: .72rem; color: var(--text-muted, var(--text-light, #6b7280)); }
@media (max-width: 600px) {
    .ep-mkts { padding: 14px; }
    .ep-mkts li { grid-template-columns: minmax(0, 1fr) auto 66px; gap: 8px; }
}

/* Board inside a builder block (the block has its own heading) and on category pages */
.ep-mkts--flat { padding-top: 14px; }
.ep-mkts--flat .ep-mkts__top { justify-content: flex-end; }
.ep-mkts--flat .ep-mkts__title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); }
.ep-block-markets { margin: 0 0 40px; }
.ep-cat-markets { margin-top: 8px; margin-bottom: 8px; }

/* ── Markets bar under the header ─────────────────────────────────── */
.ep-mbar { position: relative; z-index: 90; border-bottom: 1px solid var(--border, rgba(127,127,127,.2)); background: var(--bg-body, #fff); color: var(--text-main, #111); font-size: 13px; }
.ep-mbar__in { display: flex; align-items: center; gap: 14px; height: 38px; }
.ep-mbar__label { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; padding-right: 14px; border-right: 1px solid var(--border, rgba(127,127,127,.2)); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text, var(--accent)); }
.ep-mbar__dot { width: 7px; height: 7px; border-radius: 50%; background: #16a34a; box-shadow: 0 0 0 3px rgba(22,163,74,.18); animation: ep-mbar-blink 2.4s ease-in-out infinite; }
@keyframes ep-mbar-blink { 50% { opacity: .35; } }
.ep-mbar__view { position: relative; flex: 1; min-width: 0; display: flex; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent); }
.ep-mbar__track { flex: 0 0 auto; display: flex; align-items: center; white-space: nowrap; padding-right: 2rem; animation: ep-mbar var(--mbar-dur, 40s) linear infinite; }
.ep-mbar__view:hover .ep-mbar__track { animation-play-state: paused; }
@keyframes ep-mbar { from { transform: translateX(0); } to { transform: translateX(-100%); } }
.ep-mbar .ep-mkt { display: inline-flex; align-items: baseline; gap: 6px; margin-right: 1.6rem; font-variant-numeric: tabular-nums; }
.ep-mbar .ep-mkt__n { font-weight: 700; color: var(--text-main, #111); }
.ep-mbar .ep-mkt__p { color: var(--text-muted, #555); }
.ep-mbar .ep-mkt__c { font-weight: 700; font-size: 12px; color: var(--text-muted, #666); }
.ep-mbar .ep-mkt__c.is-up { color: #15803d; }
.ep-mbar .ep-mkt__c.is-down { color: #be123c; }
.ep-mbar .ep-mkt--wait { color: var(--text-muted, #666); }
html[data-theme="dark"] .ep-mbar .ep-mkt__c.is-up { color: #4ade80; }
html[data-theme="dark"] .ep-mbar .ep-mkt__c.is-down { color: #fb7185; }
@media (prefers-reduced-motion: reduce) {
    .ep-mbar__track { animation: none; }
    .ep-mbar__track--copy { display: none; }
    .ep-mbar__view { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
}
@media (max-width: 600px) { .ep-mbar__label { padding-right: 10px; } .ep-mbar__in { gap: 10px; } }

/* ── Sidebar widget ───────────────────────────────────────────────── */
.ep-mwid { display: flex; flex-wrap: wrap; }
.ep-mwid__r { position: absolute; opacity: 0; pointer-events: none; }
.ep-mwid__tab { flex: 1; padding: 8px 4px; border-bottom: 2px solid var(--border, rgba(127,127,127,.2)); font-size: 12px; font-weight: 700; text-align: center; color: var(--text-muted, #666); cursor: pointer; }
.ep-mwid__r:checked + .ep-mwid__tab { color: var(--text-main, #111); border-bottom-color: var(--accent); }
.ep-mwid__r:focus-visible + .ep-mwid__tab { outline: 2px solid var(--accent); outline-offset: 2px; }
.ep-mwid__list { display: none; width: 100%; list-style: none; margin: 6px 0 0; padding: 0; }
.ep-mwid__r:nth-of-type(1):checked ~ .ep-mwid__list:nth-of-type(1),
.ep-mwid__r:nth-of-type(2):checked ~ .ep-mwid__list:nth-of-type(2),
.ep-mwid__r:nth-of-type(3):checked ~ .ep-mwid__list:nth-of-type(3) { display: block; }
.ep-mwid li { display: grid; grid-template-columns: minmax(0, 1fr) auto 68px; align-items: baseline; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--border, rgba(127,127,127,.18)); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.ep-mwid li:last-child { border-bottom: 0; }
.ep-mwid .ep-mkt__c { justify-self: end; font-size: 11.5px; font-weight: 700; padding: 1px 6px; border-radius: 999px; background: color-mix(in srgb, currentColor 10%, transparent); color: var(--text-muted, #6b7280); }
.ep-mwid .ep-mkt__c.is-up { color: #15803d; }
.ep-mwid .ep-mkt__c.is-down { color: #be123c; }
html[data-theme="dark"] .ep-mwid .ep-mkt__c.is-up { color: #4ade80; }
html[data-theme="dark"] .ep-mwid .ep-mkt__c.is-down { color: #fb7185; }
