/* История → «Открытый интерес» (oi-history.js, PLAN_PUSH_OI Ш2). Переключатели — общие
   .oi-control-group / .oi-segmented вкладки ОИ, таблица — общая .block-table. */
.history-oi-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem .75rem; margin: 0 0 .75rem; }
.history-oi-form select, .history-oi-form input[type="date"] { min-height: 2rem; }
.history-oi-check { display: inline-flex; align-items: center; gap: .35rem; min-height: 2rem; color: var(--text-secondary); font-size: .75rem; cursor: pointer; }

.history-oi-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; margin-bottom: .75rem; }
.history-oi-summary[hidden] { display: none; }
.history-oi-card { min-width: 0; padding: .6rem .75rem; background: var(--bg-secondary); border: 1px solid var(--border-secondary); border-radius: var(--radius-sm); }
.history-oi-card > header { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; margin-bottom: .45rem; }
.history-oi-card > header strong { color: var(--text-primary); font-size: .8125rem; }
.history-oi-card > header span { overflow: hidden; color: var(--text-tertiary); font-size: .6875rem; text-overflow: ellipsis; white-space: nowrap; }
.history-oi-card-values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.history-oi-card-values > div { display: grid; gap: .1rem; min-width: 0; }
.history-oi-card-values span { color: var(--text-tertiary); font-size: .625rem; letter-spacing: .02em; text-transform: uppercase; }
.history-oi-card-values strong { overflow: hidden; color: var(--text-primary); font-size: 1.05rem; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.history-oi-card-values small { color: var(--text-tertiary); font-size: .6875rem; font-variant-numeric: tabular-nums; }
.history-oi .is-up { color: var(--success); }
.history-oi .is-down { color: var(--error); }

.history-oi-chart-card { margin-bottom: .75rem; overflow: hidden; background: var(--bg-primary); border: 1px solid var(--border-secondary); border-radius: var(--radius-sm); }
.history-oi-legend { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1rem; min-height: 2rem; padding: .4rem .75rem; border-bottom: 1px solid var(--border-secondary); font-size: .75rem; }
.history-oi-legend-at { color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
.history-oi-legend-item { display: inline-flex; align-items: center; gap: .35rem; color: var(--text-secondary); white-space: nowrap; }
.history-oi-legend-item i { display: inline-block; width: .9rem; height: 3px; background: currentColor; border-radius: 2px; }
.history-oi-legend-item i.is-dashed { height: 0; background: none; border-top: 2px dashed currentColor; border-radius: 0; }
.history-oi-legend-item strong { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.history-oi-stage { position: relative; height: clamp(18rem, 42vh, 28rem); }
.history-oi-chart { position: absolute; inset: 0; }
.history-oi-chart-state { position: absolute; z-index: 3; inset: 0; display: grid; place-items: center; color: var(--text-tertiary); font-size: .8125rem; background: color-mix(in srgb, var(--bg-primary) 72%, transparent); pointer-events: none; }
.history-oi-chart-state[hidden] { display: none; }

.history-oi-scroll { overflow-x: auto; }
.block-table.history-oi-table td { height: auto; padding-top: .25rem; padding-bottom: .25rem; }
.history-oi-table td .history-oi-delta { display: block; color: var(--text-tertiary); font-size: .6875rem; font-weight: 400; line-height: 1.15; }
.history-oi-table td .history-oi-delta.is-up { color: var(--success); }
.history-oi-table td .history-oi-delta.is-down { color: var(--error); }
.history-oi-time { white-space: nowrap; }
.history-oi-badge { display: inline-flex; padding: 0 .35rem; border-radius: var(--radius-sm); font-size: .625rem; font-weight: 600; line-height: 1.4; }
.history-oi-badge.is-open { color: var(--brand); border: 1px solid var(--brand); }
.history-oi-badge.is-gap { color: var(--warning); border: 1px dashed var(--warning); }
.history-oi-table tr.is-open td { background: var(--bg-hover); }
.block-table.history-oi-table td.empty-cell { color: var(--text-tertiary); font-weight: 400; text-align: center; }
.history-oi-note { margin: .5rem 0 0; color: var(--text-tertiary); font-size: .6875rem; line-height: 1.4; }

@media (max-width: 640px) {
  .history-oi-summary { grid-template-columns: 1fr; }
  .history-oi-form .oi-control-group { flex: 1 1 100%; }
  .history-oi-form .oi-segmented { width: 100%; overflow-x: auto; }
  .history-oi-form .oi-segmented button { flex: 1 0 auto; }
  .history-oi-stage { height: 20rem; }
}
