/* Trading-hours ribbon (Desktop) — a centered "world markets" strip. The visual weight tells the
   story at a glance: open markets are alive (tinted, accented, pulsing dot, session progress);
   closed markets recede. Tokens-only; rendered by wwwroot/js/trading-hours.js. */
.th-bar {
    display: flex; justify-content: center; align-items: stretch;
    flex-wrap: wrap; gap: 6px; flex: 0 0 auto;
    padding: 2px 2px 4px;
}

.th-bar .th-item {
    position: relative; overflow: hidden;
    display: flex; align-items: center; gap: 8px;
    min-width: 126px; padding: 7px 12px 9px;
    background: var(--fn-bg-alt);
    border: var(--fn-border-width) solid var(--fn-border);
    border-radius: var(--fn-radius-lg);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, opacity .18s ease;
}
.th-bar .th-item:hover { transform: translateY(-2px); box-shadow: var(--fn-elevation-2); }

/* Open markets — alive: tinted background + success accent. */
.th-bar .th-item.open { background: var(--fn-success-soft); border-color: var(--fn-success); }
/* Closed markets recede until hovered. */
.th-bar .th-item.closed { opacity: .62; }
.th-bar .th-item.closed:hover { opacity: 1; }

/* Country code as a quiet mono pill; turns into a success outline when open. */
.th-bar .th-flag {
    flex: 0 0 auto;
    font-family: ui-monospace, monospace; font-size: 10px; font-weight: 700; letter-spacing: .5px;
    color: var(--fn-text-secondary);
    background: var(--fn-bg-muted);
    border: var(--fn-border-width) solid var(--fn-border);
    border-radius: var(--fn-radius-sm); padding: 3px 5px;
}
.th-bar .th-item.open .th-flag { color: var(--fn-success); border-color: var(--fn-success); background: transparent; }

.th-bar .th-body { display: flex; flex-direction: column; min-width: 0; }
.th-bar .th-name { font-size: 13px; font-weight: 700; color: var(--fn-text); letter-spacing: .1px; }
.th-bar .th-status {
    display: flex; align-items: center; gap: 5px; margin-top: 1px; white-space: nowrap;
    font-family: ui-monospace, monospace; font-size: 10px; color: var(--fn-text-secondary);
}

.th-bar .th-dot { flex: 0 0 auto; width: 7px; height: 7px; border-radius: var(--fn-radius-round); background: var(--fn-text-tertiary); }
.th-bar .th-item.open .th-dot { background: var(--fn-success); animation: th-pulse 2.2s ease-out infinite; }

/* Soft live pulse around the dot of open markets. */
@keyframes th-pulse {
    0% { box-shadow: 0 0 0 0 var(--fn-success); }
    70% { box-shadow: 0 0 0 6px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}

/* Session progress — a thin bar along the bottom edge of open markets. */
.th-bar .th-prog { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--fn-bg-muted); }
.th-bar .th-prog > span { display: block; height: 100%; background: var(--fn-success); border-radius: 0 var(--fn-radius-sm) var(--fn-radius-sm) 0; transition: width .6s ease; }

@media (prefers-reduced-motion: reduce) { .th-bar .th-item.open .th-dot { animation: none; } }
/* On narrow screens, fall back to a horizontal scroll strip. */
@media (max-width: 720px) { .th-bar { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; } }
