/* FOREX — professional layout + chart */
.halchal-forex-page {
    --fx-accent: var(--halchal-feature-accent);
    --fx-accent-dark: var(--halchal-feature-accent-dark, #c44d00);
    --fx-buy: #e85d04;
    --fx-sell: #1d4ed8;
    --fx-up: #15803d;
    --fx-down: #b91c1c;
    --fx-text: var(--halchal-feature-text);
    --fx-muted: var(--halchal-feature-muted);
    --fx-border: var(--halchal-feature-border);
    --fx-radius: var(--halchal-feature-radius);
    --fx-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
    padding-bottom: 2.5rem;
}

.halchal-forex-page .module {
    background: transparent;
    box-shadow: none;
    border: 0;
}

.halchal-fx-page-head {
    margin-bottom: 1.25rem;
}

.halchal-fx-page-head__title {
    margin: 0 0 0.5rem;
    padding-bottom: 0.45rem;
    border-bottom: 2px solid var(--fx-accent);
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--fx-accent);
    text-transform: uppercase;
}

.halchal-fx-page-head__intro {
    margin: 0.75rem 0 0;
    max-width: 42rem;
    color: var(--fx-muted);
    line-height: var(--halchal-feature-line);
}

.halchal-fx-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin: 1.15rem 0;
    padding: 1rem 1.1rem;
    background: var(--halchal-feature-surface);
    border: 1px solid var(--fx-border);
    border-radius: var(--fx-radius);
    box-shadow: var(--fx-shadow);
}

.halchal-fx-filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
    flex: 1 1 16rem;
}

.halchal-fx-filter-form__field {
    flex: 1 1 12rem;
}

.halchal-fx-filter-form label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 700;
    font-size: var(--halchal-feature-fs-md);
}

.halchal-fx-date-input {
    min-height: var(--halchal-feature-touch, 42px);
    border-radius: 8px;
}

.halchal-fx-updated {
    margin: 0;
    color: var(--fx-muted);
    font-size: var(--halchal-feature-fs-sm);
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.halchal-fx-updated__badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: var(--halchal-feature-accent-soft, #fff8f3);
    border: 1px solid var(--fx-border);
    color: var(--fx-accent-dark);
    font-weight: 700;
    font-size: 0.85em;
}

.halchal-fx-notice {
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    background: var(--halchal-feature-notice-bg);
    border: 1px solid var(--halchal-feature-notice-border);
    border-radius: 8px;
    color: #5c4a1a;
    font-size: var(--halchal-feature-fs-sm);
}

.halchal-fx-layout {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.halchal-fx-panel {
    background: var(--halchal-feature-surface);
    border: 1px solid var(--fx-border);
    border-radius: var(--fx-radius);
    box-shadow: var(--fx-shadow);
    overflow: hidden;
}

.halchal-fx-panel__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    background: linear-gradient(180deg, var(--halchal-feature-accent-soft, #fff8f3) 0%, var(--halchal-feature-surface) 100%);
    border-bottom: 1px solid var(--fx-border);
}

.halchal-fx-panel__title {
    margin: 0;
    font-size: var(--halchal-feature-fs-lg);
    font-weight: 800;
    color: var(--fx-text);
}

.halchal-fx-share-block {
    margin: 0 0 1.25rem;
    padding: 1.15rem 1.4rem;
    border-radius: var(--fx-radius);
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #fff;
    box-shadow: var(--fx-shadow);
}

.halchal-fx-share-block__top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 1.25rem;
    margin-bottom: 0;
}

.halchal-fx-share-block__label {
    display: block;
    font-weight: 800;
    color: var(--fx-text);
    font-size: 1.05rem;
}

.halchal-fx-share-block__sub {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.88rem;
    color: var(--fx-muted);
    font-weight: 500;
}

.halchal-fx-share-block__btns {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    justify-content: flex-end;
}

.halchal-fx-share-block__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 2.85rem;
    padding: 0.65rem 1.2rem;
    border: 0;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    color: #fff !important;
    text-decoration: none !important;
    cursor: pointer;
    line-height: 1.2;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    transition: transform 0.15s ease, opacity 0.15s ease;
    font-family: inherit;
}

.halchal-fx-share-block__btn i {
    font-size: 1.15rem;
    line-height: 1;
}

.halchal-fx-share-block__btn--fb { background: #1877f2; }
.halchal-fx-share-block__btn--x { background: #0f1419; }
.halchal-fx-share-block__btn--wa { background: #25d366; }
.halchal-fx-share-block__btn--copy { background: #475569; }
.halchal-fx-share-block__btn--copy.is-copied { background: #0d9488; }

.halchal-fx-share-block__btn:hover,
.halchal-fx-share-block__btn:focus {
    opacity: 0.95;
    color: #fff !important;
    text-decoration: none !important;
    transform: translateY(-1px);
}

.halchal-fx-share-block__preview {
    padding: 0.95rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(15, 23, 42, 0.07);
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

.halchal-fx-share-block__preview-title {
    margin: 0 0 0.55rem;
    font-size: 1rem;
    font-weight: 800;
    color: #0f172a;
}

.halchal-fx-share-block__preview-body {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.55;
    color: #334155;
    word-break: break-word;
}

@media (max-width: 640px) {
    .halchal-fx-share-block__top {
        flex-direction: column;
        align-items: stretch;
    }

    .halchal-fx-share-block__btns {
        justify-content: stretch;
    }

    .halchal-fx-share-block__btn {
        flex: 1 1 calc(50% - 0.35rem);
        min-width: calc(50% - 0.35rem);
    }
}

.halchal-fx-table-wrap {
    overflow-x: auto;
}

.halchal-fx-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--halchal-feature-surface);
}

.halchal-fx-table thead th {
    padding: 0.8rem 1rem;
    text-align: left;
    background: var(--halchal-feature-surface-alt);
    border-bottom: 2px solid var(--fx-accent);
    font-size: var(--halchal-feature-fs-md);
    color: var(--fx-accent);
    font-weight: 800;
    white-space: nowrap;
}

.halchal-fx-table thead th:nth-child(2),
.halchal-fx-table thead th:nth-child(3) {
    text-align: right;
}

.halchal-fx-table td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #ece8e3;
    vertical-align: middle;
}

.halchal-fx-table tbody tr:hover td {
    background: rgba(232, 93, 4, 0.04);
}

.halchal-fx-table tbody tr.is-chart-currency td {
    background: rgba(232, 93, 4, 0.07);
}

.halchal-fx-table tbody tr.is-chart-currency td:first-child {
    box-shadow: inset 3px 0 0 var(--fx-accent);
}

.halchal-fx-currency {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}

.halchal-fx-currency__flag {
    flex-shrink: 0;
    font-size: 1.35rem;
    line-height: 1;
}

.halchal-fx-currency__text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.halchal-fx-currency__label {
    font-weight: 700;
    color: var(--fx-text);
}

.halchal-fx-currency__code {
    font-size: 0.78em;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--fx-muted);
    text-transform: uppercase;
}

.halchal-fx-table__val {
    text-align: right;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.halchal-fx-rate {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
}

.halchal-fx-trend {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    opacity: 0.9;
}

.halchal-fx-trend--up {
    border-bottom: 6px solid var(--fx-up);
    border-top: 0;
}

.halchal-fx-trend--down {
    border-top: 6px solid var(--fx-down);
    border-bottom: 0;
}

.halchal-fx-trend--flat {
    width: 8px;
    height: 2px;
    background: #9ca3af;
    border: 0;
}

.halchal-fx-chart-picker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
    padding: 0.85rem 1rem 0;
    font-size: var(--halchal-feature-fs-sm);
}

.halchal-fx-chart-picker label {
    font-weight: 700;
    color: var(--fx-muted);
}

.halchal-fx-chart-picker__select {
    flex: 1 1 12rem;
    min-height: var(--halchal-feature-touch);
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--fx-border);
    border-radius: 8px;
    font-size: var(--halchal-feature-fs-md);
    background: #fff;
}

.halchal-fx-chart-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
    padding: 0.75rem 1rem 0;
}

.halchal-fx-chart-stat {
    padding: 0.65rem 0.7rem;
    border-radius: 8px;
    border: 1px solid var(--fx-border);
    background: var(--halchal-feature-surface-alt);
}

.halchal-fx-chart-stat__label {
    display: block;
    margin-bottom: 0.15rem;
    font-size: 0.78em;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--fx-muted);
}

.halchal-fx-chart-stat__value {
    display: block;
    font-size: var(--halchal-feature-fs-price);
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.halchal-fx-chart-stat--buy .halchal-fx-chart-stat__value { color: var(--fx-buy); }
.halchal-fx-chart-stat--sell .halchal-fx-chart-stat__value { color: var(--fx-sell); }
.halchal-fx-chart-stat--change.is-up .halchal-fx-chart-stat__value { color: var(--fx-up); }
.halchal-fx-chart-stat--change.is-down .halchal-fx-chart-stat__value { color: var(--fx-down); }

.halchal-fx-chart-wrap {
    position: relative;
    margin: 0.75rem 1rem 1rem;
    padding: 0.65rem 0.35rem 0.35rem;
    background: linear-gradient(180deg, #fafafa 0%, #fff 100%);
    border: 1px solid #e8e4df;
    border-radius: 10px;
}

.halchal-fx-chart-wrap__flag {
    position: absolute;
    top: 0.55rem;
    right: 0.65rem;
    font-size: 1.25rem;
    line-height: 1;
    opacity: 0.85;
    z-index: 1;
}

.halchal-fx-chart-svg {
    display: block;
    width: 100%;
    height: auto;
    min-height: 240px;
}

.halchal-fx-chart-plot-bg {
    fill: #fff;
    stroke: #eee9e3;
    stroke-width: 1;
}

.halchal-fx-chart-grid {
    stroke: #ebe6e0;
    stroke-width: 1;
    stroke-dasharray: 4 5;
}

.halchal-fx-chart-axis-y,
.halchal-fx-chart-axis-x {
    fill: #8a8178;
    font-size: 10px;
    font-family: var(--font-body, "Ek Mukta", sans-serif);
}

.halchal-fx-chart-line {
    stroke-width: 2.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.halchal-fx-chart-line--buy { stroke: var(--fx-buy); }
.halchal-fx-chart-line--sell { stroke: var(--fx-sell); }

.halchal-fx-chart-dot {
    stroke: #fff;
    stroke-width: 2;
}

.halchal-fx-chart-dot--buy { fill: var(--fx-buy); }
.halchal-fx-chart-dot--sell { fill: var(--fx-sell); }

.halchal-fx-chart-dot-ring {
    fill: none;
    stroke-width: 1.5;
    opacity: 0.35;
}

.halchal-fx-chart-dot-ring--buy { stroke: var(--fx-buy); }
.halchal-fx-chart-dot-ring--sell { stroke: var(--fx-sell); }

.halchal-fx-chart-legend-box {
    fill: rgba(255, 255, 255, 0.92);
    stroke: #e8e4df;
    stroke-width: 1;
}

.halchal-fx-chart-legend {
    font-size: 10px;
    font-weight: 700;
    font-family: var(--font-body, "Ek Mukta", sans-serif);
}

.halchal-fx-chart-legend-dot--buy { fill: var(--fx-buy); }
.halchal-fx-chart-legend-dot--sell { fill: var(--fx-sell); }
.halchal-fx-chart-legend--buy { fill: var(--fx-buy); }
.halchal-fx-chart-legend--sell { fill: var(--fx-sell); }

.halchal-fx-chart-empty {
    margin: 0;
    padding: 2rem 1rem;
    text-align: center;
    color: var(--fx-muted);
    font-size: var(--halchal-feature-fs-sm);
}

.halchal-fx-source {
    margin-top: 1.35rem;
    padding: 1rem;
    background: var(--halchal-feature-surface-alt);
    border: 1px solid var(--fx-border);
    border-radius: var(--fx-radius);
}

.halchal-fx-source__line {
    margin: 0 0 0.5rem;
    line-height: var(--halchal-feature-line);
    color: var(--fx-muted);
}

.halchal-fx-source a {
    color: var(--fx-accent);
    font-weight: 700;
}

.btn-halchal-fx-primary {
    padding: 0.65rem 1.15rem;
    font-weight: 700;
    background: var(--fx-accent);
    border-color: var(--fx-accent);
    color: var(--halchal-feature-on-accent);
    border-radius: 8px;
    min-height: var(--halchal-feature-touch, 42px);
}

@media (min-width: 768px) {
    .halchal-fx-layout {
        flex-direction: row;
        align-items: stretch;
    }

    .halchal-fx-layout__table {
        flex: 1 1 54%;
    }

    .halchal-fx-layout__chart {
        flex: 1 1 46%;
    }
}

@media (min-width: 992px) {
    .halchal-fx-filter-form {
        max-width: 24rem;
    }

    .halchal-fx-chart-svg {
        min-height: 280px;
    }
}

@media (max-width: 520px) {
    .halchal-fx-chart-stats {
        grid-template-columns: 1fr;
    }

    .halchal-fx-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
}
