/* ==========================================================================
   FX Pulse — live signal desk (member area). Loaded only by /fx-pulse.
   Uses the tokens from styles.css (light ivory theme): champagne gold, mono numbers.
   ========================================================================== */

.fxp { font-variant-numeric: tabular-nums; }
.fxp .pos { color: var(--jade); } .fxp .neg { color: var(--danger); }
.fxp .mut { color: var(--text-2); } .fxp .fnt { color: var(--text-3); }
.fxp .dim { opacity: .45; }
.fxp small { font-size: 12px; }

/* ---------- head: title left, live status right ---------- */
.fxp-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 24px; margin-bottom: 28px; }
.fxp-head h1 { font: 400 clamp(44px, 6vw, 76px)/.95 var(--serif); letter-spacing: -.02em; margin: 14px 0 16px; }
.fxp-head .lede { max-width: 62ch; font-size: 16px; }
.fxp-pill { display: inline-flex; align-items: center; gap: 9px; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line-2); font: 500 11.5px/1 var(--mono); letter-spacing: .06em; color: var(--text-2); white-space: nowrap; }
.fxp-pill b { color: var(--text); font-weight: 500; text-transform: uppercase; letter-spacing: .14em; }
.fxp-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; }
.fxp-pill.live i { background: var(--jade); animation: fxp-beat 2s infinite; }
.fxp-pill.warn i { background: var(--gold); }
.fxp-pill.bad { border-color: var(--bad-line); }
.fxp-pill.bad i { background: var(--danger); }
@keyframes fxp-beat { 0% { box-shadow: 0 0 0 0 rgba(95, 212, 164, .5); } 70%, 100% { box-shadow: 0 0 0 7px rgba(95, 212, 164, 0); } }
@media (max-width: 760px) { .fxp-head { grid-template-columns: 1fr; align-items: start; } .fxp-pill { justify-self: start; } }
#staleBanner, #lockedNote { margin-bottom: 18px; }

/* ---------- tabs ---------- */
.fxp-tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.fxp-tabs button { all: unset; cursor: pointer; position: relative; padding: 12px 0 14px; font: 500 15px/1 var(--sans); color: var(--text-3); transition: color .18s ease-out; }
.fxp-tabs button:hover { color: var(--text); }
.fxp-tabs button[aria-selected='true'] { color: var(--gold-hi); }
.fxp-tabs button[aria-selected='true']::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--gold); }
.fxp-tabs button:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 4px; border-radius: 4px; }
.fxp-tabs .dot { display: inline-block; width: 7px; height: 7px; margin-left: 7px; border-radius: 50%; background: var(--gold); vertical-align: 2px; }
.fxp-view:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 6px; border-radius: 8px; }

/* ---------- market bar ---------- */
.fxp-market { display: flex; align-items: center; gap: 12px 18px; flex-wrap: wrap; margin-bottom: 22px; }
.fxp-sessions { display: flex; gap: 6px 16px; flex-wrap: wrap; font: 400 12px/1 var(--mono); color: var(--text-3); }
.fxp-sessions .sess { display: inline-flex; align-items: center; gap: 7px; }
.fxp-sessions .sess i { width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); }
.fxp-sessions .sess.open { color: var(--text); }
.fxp-sessions .sess.open i { background: var(--jade); }
.fxp-sessions b { font-weight: 500; }
.fxp-close { margin-left: auto; font-size: 13px; color: var(--text-2); }
.fxp-close b { color: var(--text); font: 500 14px var(--mono); }

.fxp-seg { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line-2); border-radius: 999px; }
.fxp-seg button { all: unset; cursor: pointer; padding: 7px 14px; border-radius: 999px; font: 500 12.5px/1 var(--sans); color: var(--text-2); transition: background-color .16s ease-out, color .16s ease-out; }
.fxp-seg button:hover { color: var(--text); }
.fxp-seg button[aria-pressed='true'] { background: linear-gradient(180deg, #f5e0a6 0%, #d8ae5c 52%, #b88b3b 100%); color: #1a1407; }
.fxp-seg button:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 2px; }

/* ---------- figures: one ruled strip, not a row of cards ---------- */
.fxp-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 0 8px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.fxp-stats.five { grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 18px; }
.fxp-stats > div { padding: 18px 20px 18px 0; min-width: 0; }
.fxp-stats > div + div { padding-left: 20px; border-left: 1px solid var(--line); }
.fxp-stats dt { font: 400 10.5px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); }
.fxp-stats dd { margin: 10px 0 0; font: 400 40px/1 var(--serif); }
.fxp-stats dd .of { font-size: 20px; color: var(--text-3); }
.fxp-stats dd.sub { margin-top: 8px; font: 400 12.5px/1.4 var(--sans); color: var(--text-2); }
@media (max-width: 900px) {
  .fxp-stats, .fxp-stats.five { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fxp-stats > div { padding: 16px 12px 16px 0; border-bottom: 1px solid var(--line); }
  .fxp-stats > div + div { padding-left: 0; border-left: 0; }
  .fxp-stats > div:nth-child(even) { padding-left: 16px; border-left: 1px solid var(--line); }
  .fxp-stats > div:last-child, .fxp-stats:not(.five) > div:nth-last-child(2) { border-bottom: 0; }
  .fxp-stats dd { font-size: 32px; }
}

.fxp-sec { margin: 34px 0 14px; font: 400 26px/1.1 var(--serif); display: flex; align-items: baseline; gap: 6px 14px; flex-wrap: wrap; }
.fxp-sec small { font: 400 13px/1.4 var(--sans); color: var(--text-3); }
.fxp-none { color: var(--text-3); font-size: 14px; }
.fxp-none.center { text-align: center; padding: 28px 0; }
.fxp-state { text-align: center; padding: 72px 20px; color: var(--text-2); }
.fxp-state b { display: block; font: 400 30px/1.1 var(--serif); color: var(--text); margin-bottom: 10px; }

/* ---------- badges & tags ---------- */
.fxp-tag { display: inline-grid; place-items: center; flex: none; width: 36px; height: 24px; border-radius: 6px; border: 1px solid var(--line-2); font: 500 10px/1 var(--mono); letter-spacing: .04em; color: var(--text-2); }
.fxp-badge { display: inline-flex; align-items: center; padding: 5px 8px; border-radius: 6px; font: 500 10.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; border: 1px solid var(--line-2); color: var(--text-2); }
.fxp-badge.buy, .fxp-badge.win { color: var(--ok-text); border-color: var(--ok-line); background: var(--ok-bg); }
.fxp-badge.sell, .fxp-badge.loss { color: var(--bad-text); border-color: var(--bad-line); background: var(--bad-bg); }
.fxp-badge.warn { color: var(--gold-hi); border-color: var(--tint-line); background: var(--tint); }
.fxp-badge.info { color: var(--text); border-color: var(--line-2); background: var(--hover); }

.fxp .price { font-family: var(--mono); font-weight: 500; border-radius: 4px; padding: 1px 3px; margin: -1px -3px; }
@keyframes fxp-up { from { background: rgba(95, 212, 164, .28); } to { background: transparent; } }
@keyframes fxp-dn { from { background: rgba(255, 143, 128, .28); } to { background: transparent; } }
.fxp .price.fu, .fxp-drawer .price.fu { animation: fxp-up 1.4s ease-out; }
.fxp .price.fd, .fxp-drawer .price.fd { animation: fxp-dn 1.4s ease-out; }

/* ---------- setups ---------- */
.setups { display: grid; gap: 8px; }
.setup { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap; padding: 12px 16px; border: 1px solid var(--line); border-left: 2px solid var(--gold); border-radius: var(--radius-sm); font-size: 14px; transition: background-color .16s ease-out, border-color .16s ease-out; }
.setup:hover { background: var(--hover); border-color: var(--line-2); border-left-color: var(--gold); }
.setup:focus-visible, .sig:focus-visible, .fxp-open:focus-visible, .fxp-x:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; }
.setup:active, .sig:active { transform: translateY(1px); }
.setup .txt { flex: 1; min-width: 240px; color: var(--text-2); line-height: 1.5; }
.setup .txt b { color: var(--text); font-weight: 600; }

/* ---------- open signals ---------- */
.sigs { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.sig { font: inherit; color: inherit; text-align: left; cursor: pointer; display: block; width: 100%; padding: 16px 18px; border-radius: var(--radius-sm); transition: border-color .18s ease-out; }
.sig:hover { border-color: var(--tint-line); }
.sig .top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.sig .nm { font-weight: 600; min-width: 0; }
.sig .bd { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.sig .nm small, .sig .px small { display: block; font-weight: 400; color: var(--text-3); }
.sig .px { text-align: right; font-size: 15px; }
.sig .px small.pos { color: var(--jade); } .sig .px small.neg { color: var(--danger); }
.sig .note { display: block; margin-top: 12px; font-size: 13px; line-height: 1.5; color: var(--text-2); }
.sig .note b { color: var(--text); font-weight: 600; }
/* stop → target track: the risked third is tinted, the marker is the live price */
.trk { display: block; position: relative; height: 4px; border-radius: 2px; margin: 20px 0 8px; background: rgba(95, 212, 164, .22); }
.trk .risk { position: absolute; left: 0; top: 0; height: 100%; border-radius: 2px 0 0 2px; background: rgba(255, 143, 128, .38); border-right: 1px solid var(--text-3); }
.trk .mk { position: absolute; top: -6px; width: 4px; height: 16px; margin-left: -2px; border-radius: 2px; background: var(--text); box-shadow: 0 0 0 2px var(--bg-2); transition: left .2s ease-out; }
.trk-lab { display: flex; justify-content: space-between; gap: 8px; font: 400 11px/1.3 var(--mono); color: var(--text-3); }
.sig .ft { display: flex; gap: 4px 14px; flex-wrap: wrap; margin-top: 12px; font-size: 12.5px; color: var(--text-2); }
.sig .ft b { font: 500 14px var(--mono); }

/* ---------- tables ---------- */
.fxp-table { font-size: 13.5px; }
#watch { min-width: 1080px; } #hist { min-width: 1020px; }
.fxp-table th.num, .fxp-table td.num { text-align: right; }
.fxp-table td { white-space: nowrap; }
.fxp-table td.num { font-family: var(--mono); font-size: 12.5px; }
.fxp-table tbody th { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; font-weight: 600; text-transform: none; letter-spacing: 0; font-family: var(--sans); font-size: 13.5px; color: var(--text); }
.fxp-table tbody tr:last-child > * { border-bottom: 0; }
#watch tbody tr { cursor: pointer; }
.fxp-table tbody tr:hover > * { background: var(--hover); }
.fxp-open { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; cursor: inherit; border-radius: 6px; }
button.fxp-open { cursor: pointer; }
.fxp-open { white-space: nowrap; }
.fxp-open small { display: block; font-weight: 400; color: var(--text-3); }
/* the instrument column stays in view while the table scrolls sideways */
.fxp-table thead th:first-child, .fxp-table tbody th { position: sticky; left: 0; z-index: 1; background: var(--bg); }
.fxp-table thead th:first-child { background: #f2ede3; }
.fxp-table tbody tr:hover th { background: #efe9de; }
.fxp-more { display: flex; margin: 16px auto 0; }
.fxp-table .sub { display: block; font: 400 11px/1.3 var(--sans); color: var(--text-3); }
.fxp-table thead button { all: unset; cursor: pointer; }
.fxp-table thead button:hover, .fxp-table th[aria-sort] button { color: var(--gold-hi); }
.fxp-table thead button:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; border-radius: 3px; }
.fxp-table th[aria-sort='ascending'] button::after { content: ' ↑'; }
.fxp-table th[aria-sort='descending'] button::after { content: ' ↓'; }

/* day range and stretch gauges */
.rg { position: relative; display: inline-block; vertical-align: middle; width: 110px; height: 2px; background: var(--line-2); }
.rg .ro { position: absolute; top: -4px; width: 1px; height: 10px; background: var(--text-3); }
.rg .rm { position: absolute; top: -5px; width: 4px; height: 12px; margin-left: -2px; border-radius: 2px; background: var(--text); }
.gz { position: relative; display: inline-block; vertical-align: middle; width: 120px; height: 4px; margin-right: 8px; border-radius: 2px; background: var(--track); }
.gz .zb, .gz .zs { position: absolute; top: 0; height: 100%; background: var(--gold); opacity: .55; }
.gz .zb { left: 0; border-radius: 2px 0 0 2px; } .gz .zs { right: 0; border-radius: 0 2px 2px 0; }
.gz .z0 { position: absolute; left: 50%; top: -3px; width: 1px; height: 10px; background: var(--text-3); }
.gz .zm { position: absolute; top: -5px; width: 4px; height: 14px; margin-left: -2px; border-radius: 2px; background: var(--text); box-shadow: 0 0 0 2px var(--bg-2); }
.zv { display: inline-block; width: 56px; text-align: right; font: 500 12.5px var(--mono); }

/* ---------- history ---------- */
.fxp-filters { display: flex; align-items: end; gap: 12px 14px; flex-wrap: wrap; margin-bottom: 20px; }
.fxp-field { display: grid; gap: 7px; }
.fxp-field > span { font: 400 10.5px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); }
.fxp-field select, .fxp-field input { height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--field); font-size: 14px; transition: border-color .16s ease-out, box-shadow .16s ease-out; }
.fxp-field select { appearance: none; padding-right: 34px; background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
.fxp-field select option { background: #fff; color: #15181e; }
.fxp-field input { width: 170px; }
.fxp-field select:focus-visible, .fxp-field input:focus-visible { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(168, 121, 42, .16); }
.fxp-count { margin-left: auto; font-size: 13px; color: var(--text-3); padding-bottom: 10px; }
.fxp-charts { display: grid; gap: 14px; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); margin-bottom: 18px; }
@media (max-width: 980px) { .fxp-charts { grid-template-columns: minmax(0, 1fr); } }
.fxp-chart { margin: 0; padding: 20px 20px 14px; min-width: 0; }
.fxp-chart figcaption { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin-bottom: 12px; }
.fxp-chart figcaption b { font: 400 22px/1.1 var(--serif); }
.fxp-chart figcaption > span { font-size: 12.5px; color: var(--text-3); }
.fxp-legend { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.fxp-legend i { width: 10px; height: 10px; border-radius: 2px; }
.fxp-legend i + i, .fxp-legend i.loss { margin-left: 10px; }
.fxp-legend .gain { background: var(--series-a); margin-left: 0; } .fxp-legend .loss { background: var(--series-b); }
.fxp-canvas { position: relative; height: 260px; min-width: 0; }
.fxp-honest { margin-top: 26px; padding-left: 18px; border-left: 2px solid var(--gold); max-width: 86ch; }
.fxp-honest h2 { font: 400 24px/1.1 var(--serif); margin-bottom: 10px; }
.fxp-honest p { font-size: 14px; line-height: 1.6; color: var(--text-2); }
.fxp-honest p + p { margin-top: 8px; }
.fxp-honest b { color: var(--text); font-weight: 600; }

/* ---------- alerts ---------- */
.fxp-alerts { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
@media (max-width: 880px) { .fxp-alerts { grid-template-columns: 1fr; } }
.fxp-delivery h2 { font: 400 30px/1 var(--serif); margin-bottom: 10px; }
.fxp-delivery dl { margin: 20px 0; border-top: 1px solid var(--line); }
.fxp-delivery dl > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.fxp-delivery dt { font-size: 14px; color: var(--text-2); }
.fxp-delivery dd { margin: 0; }
.fxp-alert-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.fxp-alert-list li { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.fxp-alert-list li.fxp-none { border-bottom: 0; }
.fxp-alert-list b { font-weight: 600; }
.fxp-alert-list p { margin-top: 4px; color: var(--text-2); line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
.fxp-alert-list time { flex: none; font: 400 11.5px/1.6 var(--mono); color: var(--text-3); white-space: nowrap; }
.fxp-alert-list .dlv { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.fxp-alert-list .dlv:empty { display: none; }

/* ---------- detail drawer (native dialog, docked right) ---------- */
.fxp-drawer { margin: 0 0 0 auto; width: min(640px, 100vw); max-width: none; height: 100dvh; max-height: none; padding: calc(20px + env(safe-area-inset-top, 0px)) 22px 32px; border: 0; border-left: 1px solid var(--line-2); background: var(--bg); box-shadow: -30px 0 80px -40px rgba(40, 30, 10, .4); color: var(--text); overflow-y: auto; font-variant-numeric: tabular-nums; }
.fxp-drawer[open] { animation: fxp-slide .2s ease-out; }
.fxp-drawer::backdrop { background: rgba(30, 24, 12, .35); }
@keyframes fxp-slide { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.d-head { display: flex; align-items: center; gap: 12px; }
.d-head h2 { margin-right: auto; font: 400 30px/1 var(--serif); min-width: 0; }
.d-head h2 small { display: block; margin-top: 8px; font: 400 12px/1.4 var(--sans); color: var(--text-3); }
.d-px { text-align: right; font: 500 20px/1.2 var(--mono); }
.d-px small { display: block; font: 400 12px var(--sans); }
.d-px .pos { color: var(--jade); } .d-px .neg { color: var(--danger); } .d-px .mut { color: var(--text-2); }
.fxp-x { all: unset; cursor: pointer; flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-2); transition: border-color .16s ease-out; }
.fxp-x:hover { border-color: var(--tint-line); }
.fxp-x svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; fill: none; }
.d-say { margin: 20px 0; padding-left: 14px; border-left: 2px solid var(--gold); font-size: 14px; line-height: 1.6; color: var(--text-2); }
.d-say b { color: var(--text); font-weight: 600; }
.d-say .pos { color: var(--jade); } .d-say .neg { color: var(--danger); }
.d-chart .msg { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; color: var(--text-3); }
.d-levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 20px 0 0; border-top: 1px solid var(--line); }
.d-levels > div { padding: 11px 10px 11px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.d-levels dt { font-size: 11.5px; color: var(--text-3); }
.d-levels dd { margin: 3px 0 0; font: 500 13.5px var(--mono); }
.d-track { margin-top: 16px; font-size: 12.5px; line-height: 1.55; color: var(--text-3); }
@media (max-width: 480px) { .d-levels { grid-template-columns: repeat(2, minmax(0, 1fr)); } .d-head h2 { font-size: 24px; } }

@media (forced-colors: active) {
  .trk .mk, .gz .zm, .rg .rm { background: CanvasText; }
  .fxp-seg button[aria-pressed='true'] { outline: 2px solid Highlight; }
}
