* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: #071225;
    color: #dce8ff;
    font-family: Arial, sans-serif;
}

#pageRoot {
    display: flex;
    flex-direction: column;
    height: 100vh;
    min-height: 100vh;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: #071a33;
    border-bottom: 1px solid #0e2a52;
}

.top-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.logo {
    font-weight: bold;
    font-size: 18px;
}

.feed-bulb {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: red;
}

.feed-bulb.live {
    background: #33d17a;
}

#feedText {
    font-size: 13px;
    opacity: 0.9;
}

.menu,
.top-right {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

button {
    background: #0d2547;
    color: #dce8ff;
    border: 1px solid #1c3c6b;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}

button:hover {
    border-color: #2a5ea8;
}

button.active {
    background: #1e90ff;
    border-color: #1e90ff;
}

button:disabled {
    opacity: 0.5;
    cursor: default;
}

.market-watch-wrap {
    padding: 8px 12px 10px;
    border-bottom: 1px solid #0e2a52;
}

.market-watch {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: thin;
    scrollbar-color: #173154 #071225;
}

.market-watch::-webkit-scrollbar {
    height: 8px;
}

.market-watch::-webkit-scrollbar-track {
    background: #071225;
}

.market-watch::-webkit-scrollbar-thumb {
    background: #173154;
    border-radius: 999px;
}

.mw-card {
    background: #0d2547;
    border: 1px solid #1c3c6b;
    padding: 5px 10px;
    border-radius: 8px;
    min-width: 142px;
    flex-shrink: 0;
}

button.mw-card {
    text-align: left;
}

.mw-card.live {
    cursor: pointer;
}

.mw-card.live:hover {
    border-color: #2a5ea8;
}

.mw-card.active-card {
    border-color: #32ff7e;
    box-shadow:
        inset 0 0 0 1px rgba(50,255,126,0.45),
        0 0 10px rgba(50,255,126,0.18);
}

.mw-card.dead {
    opacity: 0.88;
}

.mw-top,
.mw-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.mw-bottom {
    margin-top: 2px;
}

.mw-symbol {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.mw-center-metric {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.05;
}

.mw-center-delta.positive,
.mw-center-sentiment.positive {
    color: rgba(72, 178, 126, 0.95);
}

.mw-center-delta.negative,
.mw-center-sentiment.negative {
    color: rgba(205, 83, 86, 0.95);
}

.mw-tick {
    font-size: 12px;
    font-weight: 700;
}

.mw-metric {
    font-size: 11px;
    min-width: 50px;
}

.symbol-eur {
    color: #1e90ff;
}

.symbol-usd {
    color: #33d17a;
}

.symbol-gbp {
    color: #ff4d4f;
}

.symbol-aud {
    color: #cc6b2c;
}

.symbol-nzd {
    color: #7ec8a5;
}

.symbol-xau {
    color: #d4af37;
}

.bull-green { background: #123d2d; }
.bull-blue { background: #102f5c; }
.bear-red { background: #3d1a1a; }
.bear-yellow { background: #3d330a; }

.chart-header {
    padding: 6px 14px;
    font-size: 12px;
    color: #9bb3d9;
    border-bottom: 1px solid #0e2a52;
    background: rgba(7, 26, 51, 0.55);
}

.chart-header-line {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    min-height: 28px;
}

.inline-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.inline-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #8fb0df;
    text-transform: uppercase;
    white-space: nowrap;
}

.toggle-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border: 1px solid #1c3c6b;
    border-radius: 6px;
    background: #0d2547;
    color: #dce8ff;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.inline-pill {
    margin: 0;
}

.toggle-pill input {
    margin: 0;
    accent-color: #1e90ff;
}

.mini-btn {
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 6px;
}

.delta-gbp {
    border-color: #ff6668;
    color: #ff6668;
    background: rgba(70, 16, 22, 0.72);
}

.delta-aud {
    border-color: #eb8a46;
    color: #eb8a46;
    background: rgba(72, 36, 10, 0.72);
}

.delta-usd {
    border-color: rgba(51, 209, 122, 0.7);
    color: #33d17a;
}

.status-inline {
    margin-left: auto;
    white-space: nowrap;
}

#chartWrapper {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    background: #0a172b;
}

#watermarkLayer {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    user-select: none;
    text-align: center;
}

#wmPair {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 6px;
    text-transform: uppercase;
    margin-bottom: 10px;
    color: rgba(220, 232, 255, 0.12);
    line-height: 1;
}

.wm-ifx {
    font-size: 200px;
    font-weight: 700;
    line-height: 0.82;
    letter-spacing: 2px;
    color: rgba(220, 232, 255, 0.08);
}

.wm-trading {
    width: 100%;
    margin-top: 10px;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 14px;
    text-transform: uppercase;
    color: rgba(220, 232, 255, 0.10);
    line-height: 1;
}

#priceChart {
    position: absolute;
    inset: 0;
    z-index: 10;
    width: 100%;
    height: 100%;
}

#priceChart > div,
#priceChart canvas {
    position: relative;
    z-index: 10;
}

@media (max-width: 1100px) {
    .wm-ifx {
        font-size: 150px;
    }

    .wm-trading {
        font-size: 18px;
        letter-spacing: 10px;
    }

    #wmPair {
        font-size: 20px;
        letter-spacing: 4px;
    }
}

@media (max-width: 820px) {
    .topbar {
        padding: 8px 10px;
    }

    .market-watch-wrap {
        padding: 8px 10px 10px;
    }

    .mw-card {
        min-width: 132px;
    }

    .status-inline {
        margin-left: 0;
    }
}

@media (max-width: 700px) {
    .wm-ifx {
        font-size: 110px;
    }

    .wm-trading {
        font-size: 14px;
        letter-spacing: 7px;
    }

    #wmPair {
        font-size: 16px;
        letter-spacing: 3px;
    }
}

.tf-btn {
appearance: none;
border: 1px solid #214a7a;
background: #0d2746;
color: #cfe4ff;
border-radius: 6px;
padding: 4px 10px;
cursor: pointer;
}

.tf-btn.active {
background: #1f7ae0;
color: #ffffff;
border-color: #1f7ae0;
}
.tf-btn {
appearance: none;
border: 1px solid #214a7a;
background: #0d2746;
color: #cfe4ff;
border-radius: 6px;
padding: 4px 10px;
cursor: pointer;
}

.tf-btn.active {
background: #1f7ae0;
color: #ffffff;
border-color: #1f7ae0;
}
.m2-transition-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    pointer-events: auto;
    z-index: 8;
    opacity: 0.95;
    box-shadow: 0 0 14px currentColor;
}

.m2-transition-line.m2-bullish {
    color: #00b7ff;
    background: linear-gradient(to bottom, rgba(0,183,255,0), rgba(0,183,255,0.95), rgba(0,183,255,0));
}

.m2-transition-line.m2-bearish {
    color: #fff200;
    background: linear-gradient(to bottom, rgba(255,242,0,0), rgba(255,242,0,0.95), rgba(255,242,0,0));
}

/* iSO Synthetic Orders overlay */
#chartWrapper {
    position: relative;
}

#ifxSyntheticOrdersLayer {
    position: absolute;
    inset: 0;
    z-index: 35;
    pointer-events: none;
    overflow: hidden;
}

.ifx-so-dot {
    position: absolute;
    width: 7px;
    height: 7px;
    margin-left: -3.5px;
    margin-top: -3.5px;
    border-radius: 999px;
    opacity: 0.9;
    pointer-events: none;
    box-shadow: 0 0 7px currentColor;
    transform: translate3d(0, 0, 0);
}

.ifx-so-dot.pressure {
    width: 8px;
    height: 8px;
    margin-left: -4px;
    margin-top: -4px;
    opacity: 0.98;
    box-shadow: 0 0 11px currentColor;
}

.ifx-so-dot.sentiment-premium,
.ifx-so-dot.sentiment_premium {
    background: #19e985;
    color: #19e985;
}

.ifx-so-dot.sentiment-discount,
.ifx-so-dot.sentiment_discount {
    background: #ff4d4f;
    color: #ff4d4f;
}

.ifx-so-dot.delta-bullish,
.ifx-so-dot.delta_bullish {
    background: #2f9cff;
    color: #2f9cff;
}

.ifx-so-dot.delta-bearish,
.ifx-so-dot.delta_bearish {
    background: #ffd447;
    color: #ffd447;
}

.ifx-iso-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 8px;
    padding: 2px 8px;
    border: 1px solid #1c3c6b;
    border-radius: 7px;
    background: rgba(7, 26, 51, 0.78);
    color: #dce8ff;
    font-size: 11px;
    line-height: 1.2;
}

.ifx-iso-inline label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.ifx-iso-inline select {
    height: 22px;
    border: 1px solid #214a7a;
    border-radius: 5px;
    background: #0d2746;
    color: #ffffff;
    font-size: 11px;
}

.iso-lab-panel {
    border-color: rgba(47, 156, 255, 0.48);
}

.iso-lab-summary strong {
    color: #ffffff;
}
