:root {
    --fx: #10b981;
    --fx-bg: rgba(16,185,129,.12);
}

.ticker-scroll {
    animation-name: fxTickerMove;
}

@keyframes fxTickerMove {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.fx-hero {
    background: linear-gradient(135deg,var(--primary-light) 0%,#0f6b58 100%);
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.fx-hero::before {
    content: '';
    position: absolute;
    right: -70px;
    top: -70px;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: rgba(255,255,255,.08);
}

.fx-hero::after {
    content: 'FX';
    position: absolute;
    right: 34px;
    top: 34px;
    font-family: var(--mono);
    font-size: 88px;
    font-weight: 800;
    opacity: .12;
    color: #fff;
}

.hero-title {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 8px;
}

.hero-subtitle {
    font-size: 14px;
    color: rgba(255,255,255,.76);
    margin-bottom: 24px;
}

.hero-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.hero-stat {
    min-width: 180px;
    color: #fff;
}

.hero-stat-label {
    font-size: 11px;
    color: rgba(255,255,255,.62);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 4px;
}

.hero-stat-val {
    font-family: var(--mono);
    font-size: 22px;
    font-weight: 800;
    color: #fff;
}

.hero-stat-change {
    font-size: 12px;
    font-weight: 700;
    margin-top: 3px;
    color: rgba(255,255,255,.82);
}

.price-cards {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.price-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.price-card-header,
.pc-buy-sell {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.price-card-brand {
    font-size: 18px;
    font-weight: 800;
}

.price-card-type {
    font-size: 12px;
    color: var(--text3);
}

.pc-badge {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--fx-bg);
    color: var(--primary-light);
    font-size: 18px;
}

.pc-col-label {
    font-size: 11px;
    color: var(--text3);
    text-transform: uppercase;
}

.pc-col-val {
    font-family: var(--mono);
    font-size: 16px;
    font-weight: 700;
}

.badge-change {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 11px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    width: max-content;
}

.badge-up {
    background: var(--fx-bg);
    color: var(--primary-light);
}

.badge-flat {
    background: rgba(71,97,121,.12);
    color: var(--text2);
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0,1.6fr) minmax(320px,.9fr);
    gap: 24px;
}

.chart-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.period-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.period-pill {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text2);
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.period-pill.active {
    background: var(--primary-light);
    border-color: var(--primary-light);
    color: #fff;
}

.fx-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin: 18px 0;
}

.fx-select-wrap {
    min-width: 240px;
    flex: 1;
}

.fx-toolbar-label,
.small-label {
    display: block;
    font-size: 12px;
    color: var(--text3);
    font-weight: 600;
    margin-bottom: 6px;
}

.fx-input {
    width: 100%;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    color: var(--text);
    font-family: inherit;
    outline: none;
}

.fx-summary-grid {
    display: grid;
    grid-template-columns: repeat(4,minmax(110px,1fr));
    gap: 12px;
    flex: 2;
}

.fx-summary-item {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px;
}

.fx-summary-label {
    font-size: 11px;
    color: var(--text3);
    text-transform: uppercase;
}

.fx-summary-value {
    font-family: var(--mono);
    font-size: 16px;
    font-weight: 700;
    margin-top: 8px;
}

.chart-wrap {
    height: 340px;
}

.history-row,
.world-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.history-row:last-child,
.world-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.history-date,
.world-label {
    font-size: 12px;
    color: var(--text3);
}

.history-val,
.world-val {
    font-family: var(--mono);
    font-weight: 700;
}

.world-name {
    font-size: 13px;
    font-weight: 700;
    margin-top: 4px;
}

.fx-btn {
    width: 100%;
    margin-top: 4px;
    border: none;
    background: linear-gradient(135deg,var(--primary-light),#0f6b58);
    color: #fff;
    border-radius: 12px;
    padding: 12px 16px;
    font-weight: 700;
}

.fx-result {
    margin-top: 14px;
    padding: 16px;
    border-radius: 16px;
    background: linear-gradient(135deg,rgba(16,185,129,.15),rgba(16,185,129,.04));
    border: 1px solid rgba(16,185,129,.2);
}

.fx-result-val {
    font-family: var(--mono);
    font-size: 22px;
    font-weight: 800;
}

.fx-result-label {
    font-size: 12px;
    color: var(--text2);
    margin-top: 6px;
}

.source-widget {
    border: 1.5px solid rgba(16,185,129,.25);
}

@media (max-width: 1200px) {
    .price-cards {
        grid-template-columns: repeat(2,1fr);
    }

    .content-grid {
        grid-template-columns: 1fr;
    }

    .fx-summary-grid {
        grid-template-columns: repeat(2,minmax(110px,1fr));
    }
}

@media (max-width: 768px) {
    .fx-hero {
        padding: 24px;
    }

    .hero-title {
        font-size: 24px;
    }

    .hero-stats {
        display: grid;
        grid-template-columns: repeat(2,minmax(0,1fr));
        gap: 14px;
    }

    .hero-stat {
        min-width: 0;
        background: rgba(255,255,255,.08);
        padding: 14px;
        border-radius: 14px;
    }

    .price-cards {
        grid-template-columns: 1fr;
    }

    .chart-top,
    .fx-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .fx-summary-grid {
        grid-template-columns: repeat(2,minmax(0,1fr));
    }

    .chart-wrap {
        height: 280px;
    }
}

@media (max-width: 560px) {
    .hero-stats,
    .fx-summary-grid {
        grid-template-columns: 1fr;
    }

    .hero-stat-val {
        font-size: 20px;
    }

    .fin-table {
        min-width: 640px;
    }
}
