/* Forex market hours: live session banner (tools page) and the market hours page. */
:root { --s-sydney: #14b8c8; --s-tokyo: #e64980; --s-london: #4a5fd9; --s-newyork: #f59f00; --fxe-ink: #1f2440; --fxe-muted: #5f6478; --fxe-line: #e7e8ee; --fxe-soft: #f3f4ff; }
[data-session="sydney"], [data-map-pin="sydney"], [data-swatch="sydney"] { --s: var(--s-sydney); }
[data-session="tokyo"], [data-map-pin="tokyo"], [data-swatch="tokyo"] { --s: var(--s-tokyo); }
[data-session="london"], [data-map-pin="london"], [data-swatch="london"] { --s: var(--s-london); }
[data-session="newyork"], [data-map-pin="newyork"], [data-swatch="newyork"] { --s: var(--s-newyork); }

/* Live status card */
.fxe-live { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 20px; border-radius: 20px; color: #fff;
    background: radial-gradient(120% 140% at 100% 0, #8b6cff 0, transparent 55%), linear-gradient(155deg, #1d2670 0%, #3446c4 60%, #4a5fd9 100%); box-shadow: 0 18px 40px -24px rgb(38 49 138 / .7); }
.fxe-live::after { content: ''; position: absolute; right: -80px; bottom: -120px; width: 300px; height: 300px; border: 1px solid rgb(255 255 255 / .14); border-radius: 50%;
    box-shadow: 0 0 0 36px rgb(255 255 255 / .03), 0 0 0 72px rgb(255 255 255 / .02); pointer-events: none; }
@media (min-width: 900px) { .fxe-live { grid-template-columns: minmax(260px, .8fr) minmax(0, 1.6fr); align-items: center; gap: 28px; padding: 26px 28px; } }
a.fxe-live { text-decoration: none; transition: transform .25s, box-shadow .25s; }
a.fxe-live:hover { transform: translateY(-2px); box-shadow: 0 24px 48px -24px rgb(38 49 138 / .8); }
a.fxe-live:focus-visible { outline: 3px solid #b4bdff; outline-offset: 3px; }
.fxe-live__status { position: relative; z-index: 1; display: grid; gap: 6px; min-width: 0; }
.fxe-live__eyebrow { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; opacity: .8; }
.fxe-live__dot { width: 8px; height: 8px; border-radius: 50%; background: #b5b9c9; }
[data-state="open"] .fxe-live__dot { background: #4ade80; animation: fxe-pulse 2s infinite; }
[data-state="next"] .fxe-live__dot { background: #fbbf24; }
[data-state="closed"] .fxe-live__dot { background: #f87171; }
.fxe-live__headline { margin: 0; font-size: clamp(20px, 2.4vw, 26px); font-weight: 700; line-height: 1.2; }
.fxe-live__count { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin: 0; font-size: 13px; opacity: .95; }
.fxe-live__count time { font-size: clamp(30px, 4vw, 42px); font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.fxe-live__sessions { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
@media (min-width: 640px) { .fxe-live__sessions { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.fxe-live__session { display: grid; gap: 2px; min-width: 0; padding: 12px; border: 1px solid rgb(255 255 255 / .14); border-radius: 14px; background: rgb(255 255 255 / .07); transition: background .3s, border-color .3s; }
.fxe-live__session[data-open="true"] { border-color: color-mix(in srgb, var(--s) 70%, #fff); background: color-mix(in srgb, var(--s) 26%, transparent); }
.fxe-live__city { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; }
.fxe-live__city i { flex-shrink: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--s); box-shadow: 0 0 0 2px rgb(255 255 255 / .25); }
.fxe-live__clock { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.fxe-live__state { justify-self: start; margin: 2px 0; padding: 1px 8px; border-radius: 99px; background: rgb(255 255 255 / .14); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.fxe-live__session[data-open="true"] .fxe-live__state { background: #dcfce7; color: #14532d; }
.fxe-live__until { font-size: 11px; opacity: .85; }
.fxe-live__until time { font-variant-numeric: tabular-nums; font-weight: 600; }
.fxe-live__hours { margin-top: 6px; padding-top: 6px; border-top: 1px dashed rgb(255 255 255 / .2); font-size: 11px; opacity: .85; }
.fxe-live__hours b { display: block; font-size: 13px; font-variant-numeric: tabular-nums; }
.fxe-live__go { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 6px; justify-self: start; font-size: 13px; font-weight: 600; }
@media (min-width: 900px) { .fxe-live__go { grid-column: 2; justify-self: end; margin-top: -6px; } }
a.fxe-live:hover .fxe-live__go svg { transform: translateX(3px); }
.fxe-live__go svg { transition: transform .2s; }
@keyframes fxe-pulse { 0% { box-shadow: 0 0 0 0 rgb(74 222 128 / .6); } 70%, 100% { box-shadow: 0 0 0 7px rgb(74 222 128 / 0); } }

/* Market hours page */
.fxe-hours { display: flex; flex-direction: column; gap: 32px; color: var(--fxe-ink); }
.fxe-hours__head { display: flex; flex-direction: column; gap: 8px; max-width: 780px; }
.fxe-hours__board { display: grid; gap: 12px; }
.fxe-hours__clocks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; }
.fxe-hours__clocks div { padding: 14px 16px; border: 1px solid var(--fxe-line); border-radius: 14px; background: #fff; }
.fxe-hours__clocks dt { font-size: 12px; color: var(--fxe-muted); overflow-wrap: anywhere; }
.fxe-hours__clocks dt small { font-size: 11px; }
.fxe-hours__clocks dd { margin: 4px 0 0; font-size: clamp(18px, 2.4vw, 26px); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--fxe-ink); }
@media (max-width: 560px) { .fxe-hours__clocks { grid-template-columns: 1fr 1fr; } .fxe-hours__clocks div:last-child { grid-column: 1 / -1; } }
.fxe-hours__card { display: grid; gap: 16px; padding: 20px; border-radius: 20px; background: #fff url('../images/noise-tools.webp'); box-shadow: 0 0 8px 0 rgba(0, 0, 0, .08); }
@media (min-width: 768px) { .fxe-hours__card { padding: 24px; } }
.fxe-hours__card-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; }
.fxe-hours__card-head > div:first-child { display: grid; gap: 6px; max-width: 680px; }

/* Day/night dot map (canvas) with session pins */
.fxe-map { --map-land-day: #7d8ae2; --map-land-night: #1b2263; --map-sea-day: #e6e9f8; --map-sea-night: #a9b0d8; position: relative; }
.fxe-map canvas { display: block; width: 100%; }
.fxe-map__pin { position: absolute; z-index: 1; display: flex; align-items: center; gap: 6px; padding: 3px 9px 3px 4px; border: 1px solid var(--fxe-line); border-radius: 99px;
    background: rgb(255 255 255 / .94); box-shadow: 0 6px 16px -8px rgb(0 0 0 / .35); font-size: 12px; white-space: nowrap; transform: translate(-12px, -50%); }
.fxe-map__pin i { position: relative; width: 14px; height: 14px; border: 3px solid #fff; border-radius: 50%; background: #b5b9c9; box-shadow: 0 0 0 1px var(--fxe-line); }
.fxe-map__pin[data-open="true"] i { background: var(--s); box-shadow: 0 0 0 1px var(--s); }
.fxe-map__pin[data-open="true"] i::after { content: ''; position: absolute; inset: -6px; border: 2px solid var(--s); border-radius: 50%; animation: fxe-ring 1.8s ease-out infinite; }
.fxe-map__pin b { font-weight: 600; color: var(--fxe-ink); }
.fxe-map__pin small { color: var(--fxe-muted); font-variant-numeric: tabular-nums; }
@keyframes fxe-ring { from { opacity: .9; transform: scale(.6); } to { opacity: 0; transform: scale(1.6); } }
@media (max-width: 640px) { .fxe-map__pin { padding: 2px; font-size: 0; } .fxe-map__pin b, .fxe-map__pin small { display: none; } }
.fxe-map-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0; padding: 0; list-style: none; font-size: 12px; color: var(--fxe-muted); }
.fxe-map-legend li { display: inline-flex; align-items: center; gap: 6px; }
.fxe-map-legend i { width: 10px; height: 10px; border-radius: 50%; }
.fxe-map-legend .is-day { background: #7d8ae2; } .fxe-map-legend .is-night { background: #1b2263; }
.fxe-map-legend .is-open { background: #4a5fd9; box-shadow: 0 0 0 3px rgb(74 95 217 / .25); } .fxe-map-legend .is-closed { background: #b5b9c9; }

/* 24-hour timeline */
.fxe-zone-switch { display: inline-flex; padding: 3px; border: 1px solid var(--fxe-line); border-radius: 10px; background: #fff; }
.fxe-zone-switch label { position: relative; }
.fxe-zone-switch input { position: absolute; opacity: 0; pointer-events: none; }
.fxe-zone-switch span { display: block; padding: 7px 14px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--fxe-muted); cursor: pointer; transition: background .2s, color .2s; }
.fxe-zone-switch input:checked + span { background: #4a5fd9; color: #fff; }
.fxe-zone-switch input:focus-visible + span { outline: 2px solid #4a5fd9; outline-offset: 2px; }
.fxe-timeline { overflow-x: auto; }
.fxe-timeline__grid { position: relative; display: grid; gap: 8px; min-width: 620px; }
.fxe-timeline__row, .fxe-timeline__ruler, .fxe-timeline__overlay { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: 12px; }
.fxe-timeline__label { font-size: 13px; font-weight: 600; color: var(--fxe-ink); }
.fxe-timeline__track { position: relative; height: 34px; border-radius: 8px; background: repeating-linear-gradient(90deg, transparent 0 calc(12.5% - 1px), var(--fxe-line) calc(12.5% - 1px) 12.5%), var(--fxe-soft); }
.fxe-timeline__ruler .fxe-timeline__track { height: 18px; background: none; }
.fxe-timeline__ruler .fxe-timeline__track span { position: absolute; top: 0; font-size: 11px; color: var(--fxe-muted); font-variant-numeric: tabular-nums; transform: translateX(-50%); }
.fxe-timeline__ruler .fxe-timeline__track span:first-child { transform: none; }
.fxe-timeline__ruler .fxe-timeline__track span:last-child { transform: translateX(-100%); }
.fxe-timeline__bar { position: absolute; top: 4px; bottom: 4px; display: flex; align-items: center; min-width: 4px; padding: 0 8px; overflow: hidden; border-radius: 6px; background: var(--s);
    box-shadow: inset 0 -2px 0 rgb(0 0 0 / .12); }
.fxe-timeline__bar em { overflow: hidden; color: #fff; font-size: 11px; font-style: normal; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; text-overflow: ellipsis; }
.fxe-timeline__row.is-activity .fxe-timeline__label { font-size: 11px; font-weight: 500; color: var(--fxe-muted); }
.fxe-timeline__heat { display: flex; height: 16px; overflow: hidden; background: none; }
.fxe-timeline__heat i { flex: 1; background: #eef0f8; }
.fxe-timeline__heat i[data-level="1"] { background: #c9cff3; } .fxe-timeline__heat i[data-level="2"] { background: #7e8ce6; }
.fxe-timeline__heat i[data-level="3"], .fxe-timeline__heat i[data-level="4"] { background: #2f3fb8; }
.fxe-timeline__overlay { position: absolute; inset: 0; pointer-events: none; }
.fxe-timeline__overlay .fxe-timeline__track { height: 100%; background: none; }
.fxe-timeline__now { position: absolute; top: 0; bottom: 0; width: 2px; background: #e03131; }
.fxe-timeline__now b { position: absolute; top: -2px; left: 50%; padding: 1px 6px; border-radius: 6px; background: #e03131; color: #fff; font-size: 10px; font-weight: 700; white-space: nowrap; transform: translateX(-50%); }
.fxe-timeline__weekend[hidden] { display: none; }

/* Table + notes */
.fxe-hours__table { overflow-x: auto; }
.fxe-hours__table table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 14px; }
.fxe-hours__table th, .fxe-hours__table td { padding: 12px 14px; border-top: 1px solid var(--fxe-line); text-align: left; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fxe-hours__table thead th { border-top: 0; background: var(--fxe-soft); font-size: 12px; font-weight: 600; color: var(--fxe-muted); }
.fxe-hours__table tbody th { font-weight: 600; white-space: nowrap; }
.fxe-swatch { display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 3px; background: var(--s); vertical-align: middle; }
.fxe-hours__notes { display: grid; gap: 24px; }
@media (min-width: 768px) { .fxe-hours__notes { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.fxe-hours__notes section { display: flex; flex-direction: column; gap: 8px; }

@media (prefers-reduced-motion: reduce) {
    [data-state="open"] .fxe-live__dot, .fxe-map__pin[data-open="true"] i::after { animation: none; }
    a.fxe-live, a.fxe-live:hover { transform: none; transition: none; }
}
