/* The chart owns its drawing area; legacy Bootstrap columns do not size its axes. */
.safex-current-prices {
    overflow-x: auto;
}
.safex-current-prices .dataTables_wrapper {
    width: 100%;
}
.safex-current-prices table.table {
    width: 100% !important;
    margin: 0 !important;
}
.ovk-safex-chart {
    margin: 24px 0;
    padding: 24px;
    border: 1px solid #dce3e9;
    border-radius: 6px;
    background: #fff;
    color: #3e3e3e;
    font-size: 14px;
}
.ovk-safex-chart [hidden] {
    display: none !important;
}
.ovk-safex-chart .safex-chart-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px 20px;
    margin-bottom: 18px;
}
.ovk-safex-chart .safex-chart-heading h2 {
    color: #033b6e;
    font-size: 24px;
    font-weight: 600;
    margin: 0;
}
.ovk-safex-chart .safex-chart-status {
    padding: 12px 0;
    margin: 0;
}
.ovk-safex-chart .safex-chart-status.is-warning,
.ovk-safex-chart .safex-chart-range-error {
    color: #795000;
    background: #fff5dc;
    padding: 12px;
    border-left: 3px solid #b57c16;
}
.ovk-safex-chart .safex-chart-instruments {
    padding: 0;
    border: 0;
    margin: 0 0 20px;
    min-width: 0;
}
.ovk-safex-chart .safex-chart-instruments legend {
    border: 0;
    float: none;
    width: auto;
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 8px;
    padding: 0;
}
.ovk-safex-chart .safex-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 13px;
}
.ovk-safex-chart .safex-chart-legend label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    margin: 0;
    font-size: 12px;
}
.ovk-safex-chart .safex-chart-legend input {
    margin: 0;
    width: 17px;
    height: 17px;
    accent-color: #0158a8;
}

.safex-chart-controls {
    margin-left: 20px;
    margin-right: 40px;
}
.ovk-safex-chart .safex-chart-swatch {
    display: inline-block;
    flex-shrink: 0;
    width: 18px;
    height: 3px;
}
.ovk-safex-chart .safex-chart-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: end;
    gap: 14px;
    margin-bottom: 18px;
}

.ovk-safex-chart .safex-chart-ranges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.ovk-safex-chart .safex-chart-ranges button {
    border: 1px solid #0158a8;
    color: #0158a8;
    background: #fff;
    border-radius: 3px;
    padding: 8px 12px;
    min-height: 38px;
    font-size: 14px;
}
.ovk-safex-chart .safex-chart-ranges button[aria-pressed="true"] {
    background: #0158a8;
    color: #fff;
}
.ovk-safex-chart .safex-chart-dates {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.ovk-safex-chart .safex-chart-dates label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    margin: 0;
}
.ovk-safex-chart .safex-chart-dates input {
    max-width: 100%;
    min-height: 38px;
    padding: 6px 8px;
    border: 1px solid #bac8d4;
    border-radius: 3px;
    color: #033b6e;
    background: #fff;
    font-size: 14px;
}
.ovk-safex-chart .safex-chart-plot {
    position: relative;
    width: 100%;
    min-width: 0;
}
.ovk-safex-chart .safex-chart-svg {
    display: block;
    width: 100%;
    height: 360px;
    overflow: hidden;
    touch-action: pan-y;
}
.ovk-safex-chart .safex-chart-svg text {
    fill: #505b65;
    font-size: 12px;
    font-family: Arial, sans-serif;
}
.ovk-safex-chart .safex-chart-grid {
    stroke: #e5ebef;
    stroke-width: 1;
}
.ovk-safex-chart .safex-chart-line {
    fill: none;
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
}
.ovk-safex-chart .safex-chart-cursor {
    stroke: #6c757d;
    stroke-width: 1;
    stroke-dasharray: 4 4;
    pointer-events: none;
}
.ovk-safex-chart .safex-chart-markers {
    pointer-events: none;
    stroke: #fff;
    stroke-width: 2;
}
.ovk-safex-chart .safex-chart-tooltip {
    position: absolute;
    z-index: 2;
    box-sizing: border-box;
    width: max-content;
    max-width: calc(100% - 16px);
    padding: 10px 12px;
    border: 1px solid #0158a8;
    border-radius: 5px;
    background: #fff;
    color: #3e3e3e;
    box-shadow: 0 3px 12px #033b6e26;
    pointer-events: none;
    font-size: 13px;
    line-height: 1.5;
}
.ovk-safex-chart .safex-chart-tooltip-date {
    display: block;
    margin-bottom: 6px;
    color: #033b6e;
}
.ovk-safex-chart .safex-chart-tooltip-row {
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 3px 0;
}
.ovk-safex-chart .safex-chart-tooltip-row .safex-chart-swatch {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}
.ovk-safex-chart .safex-chart-tooltip-row > strong {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.ovk-safex-chart .safex-chart-data {
    margin-top: 16px;
    border: 1px solid #dce3e9;
    border-radius: 5px;
}
.ovk-safex-chart .safex-chart-data summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 54px;
    padding: 14px 16px;
    border-radius: 4px;
    background: #0158a8;
    color: #fff;
    cursor: pointer;
    list-style: none;
    font-size: 16px;
    font-weight: 600;
}
.ovk-safex-chart .safex-chart-data summary::-webkit-details-marker {
    display: none;
}
.ovk-safex-chart .safex-chart-data summary::marker {
    content: '';
}
.ovk-safex-chart .safex-chart-data[open] summary {
    border-radius: 4px 4px 0 0;
}
.ovk-safex-chart .safex-chart-collapse-icon::before {
    content: '+';
    font-size: 26px;
    line-height: 1;
    font-weight: 400;
}
.ovk-safex-chart .safex-chart-data[open] .safex-chart-collapse-icon::before {
    content: '\2212';
}
.ovk-safex-chart .safex-chart-table-wrap {
    max-height: 320px;
    overflow: auto;
}
.ovk-safex-chart .safex-chart-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.ovk-safex-chart .safex-chart-table th,
.ovk-safex-chart .safex-chart-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #dce3e9;
    text-align: right;
    white-space: nowrap;
}
.ovk-safex-chart .safex-chart-table th:first-child,
.ovk-safex-chart .safex-chart-table td:first-child {
    text-align: left;
}
.ovk-safex-chart .safex-chart-table thead {
    position: sticky;
    top: 0;
    background: #f5f8fa;
}
.ovk-safex-chart :is(button, input, summary, svg, a):focus-visible {
    outline: 2px solid #0158a8;
    outline-offset: 3px;
}
@media (max-width: 575px) {
    .ovk-safex-chart {
        padding: 14px 10px;
    }
    .ovk-safex-chart .safex-chart-heading h2 {
        font-size: 21px;
    }
    .ovk-safex-chart .safex-chart-legend {
        gap: 12px;
    }
    .ovk-safex-chart .safex-chart-ranges button {
        padding: 8px 10px;
    }
    .ovk-safex-chart .safex-chart-dates {
        width: 100%;
    }
    .ovk-safex-chart .safex-chart-dates label {
        flex: 1;
        min-width: 0;
    }
}

/* Stable column proportions; small screens scroll the tables rather than squeezing prices. */
.safex-current-prices table.table {
    table-layout: fixed;
    min-width: 800px;
}
.safex-current-prices .safex-col-commodity {
    width: 32%;
}
.safex-current-prices .safex-col-price {
    width: 19%;
}
.safex-current-prices .safex-col-time {
    width: 14%;
}
.safex-current-prices .safex-col-close {
    width: 21%;
}
.safex-current-prices .safex-col-change {
    width: 14%;
}
.safex-current-prices table.table th {
    white-space: normal;
    vertical-align: middle;
    text-align: right;
    padding: 12px;
}
.safex-current-prices table.table th:first-child {
    text-align: left;
}
.safex-current-prices table.table tbody td {
    white-space: nowrap;
    padding: 12px;
    font-variant-numeric: tabular-nums;
}
.safex-current-prices table.table tbody td:not(:first-child) {
    text-align: right;
}
/* Let full commodity names size their columns inside the scrollable wrapper. */
.ovk-safex-chart .safex-chart-table {
    table-layout: auto;
    width: max-content;
    min-width: 100%;
}
.ovk-safex-chart .safex-chart-table th:first-child {
    width: 140px;
}
.ovk-safex-chart .safex-chart-table-caption {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
.safex-delay-note {
    font-weight: 600;
    text-transform: none;
}

.ovk-safex-chart .safex-chart-navigator {
    margin-top: 6px;
    margin-bottom: 32px;
}
.ovk-safex-chart .safex-chart-navigator-track {
    position: relative;
    height: 56px;
    border: 1px solid #c9d5df;
    background: #f5f8fa;
    cursor: crosshair;
    touch-action: none;
    user-select: none;
}
.ovk-safex-chart .safex-chart-overview {
    display: block;
    width: 100%;
    height: 76px;
    overflow: visible;
    pointer-events: none;
}
.ovk-safex-chart .safex-chart-overview-line {
    fill: none;
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}
.ovk-safex-chart .safex-chart-overview text {
    fill: #626e78;
    font: 11px Arial, sans-serif;
}
.ovk-safex-chart .safex-chart-window {
    position: absolute;
    top: 0;
    height: 100%;
    min-width: 1px;
    padding: 0;
    border: 1px solid #0158a8;
    border-radius: 0;
    background: #0158a825;
    cursor: grab;
    touch-action: none;
}
.ovk-safex-chart .safex-chart-window:active {
    cursor: grabbing;
}
.ovk-safex-chart .safex-chart-handle {
    position: absolute;
    top: 0;
    width: 24px;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    transform: translateX(-50%);
    cursor: ew-resize;
    touch-action: none;
}
.ovk-safex-chart .safex-chart-handle::after {
    content: '\2016';
    position: absolute;
    top: 12px;
    left: 6px;
    width: 12px;
    height: 30px;
    border: 1px solid #0158a8;
    border-radius: 2px;
    background: #fff;
    color: #0158a8;
    font: 14px/28px Arial, sans-serif;
    text-align: center;
}
.ovk-safex-chart .safex-chart-handle:focus-visible {
    z-index: 1;
}
.ovk-safex-chart .safex-chart-handle:disabled,
.ovk-safex-chart .safex-chart-window:disabled {
    cursor: default;
}

.ovk-safex-chart .safex-chart-table thead th {
    font-size: 12px;
    white-space: nowrap;
}

/* Retain accessible selected-date values without the visible blue summary strip. */
.ovk-safex-chart .safex-chart-readout {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    border: 0;
    white-space: nowrap;
}
