/* Option price jumps: a window control, the two mover panels and the full table. */
.opc-page { --opc-up: #1f9d55; --opc-down: #d63939; --opc-blue: #2563eb; --opc-amber: #d97706; --opc-line: var(--tw-gray-200, #e5e7eb); --opc-soft: var(--tw-gray-100, #f3f4f6); }
.opc-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem 2rem; padding-bottom: 1rem; }
.opc-title h1 { font-size: 1.35rem; font-weight: 600; line-height: 1.2; color: var(--tw-gray-900); margin: 0 0 .35rem; }
.opc-title p { font-size: .8rem; color: var(--tw-gray-600); max-width: 60ch; margin: 0; line-height: 1.5; }
.opc-chips .stat-chip__value { font-variant-numeric: tabular-nums; }
.opc-chips .stat-chip__value.is-off { color: var(--opc-down); }
.opc-chips .stat-chip__value.is-on { color: var(--opc-up); }

/* The underlyings, one pill each: last price, session and day changes, and the chosen window. */
.opc-context { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1rem; }
.opc-context:empty { display: none; }
.opc-pill { display: inline-flex; align-items: baseline; gap: .55rem; padding: .35rem .7rem; border: 1px solid var(--opc-line); border-radius: 999px; background: var(--tw-light, #fff); font-size: .78rem; font-variant-numeric: tabular-nums; color: var(--tw-gray-700); }
.opc-pill b { font-weight: 600; color: var(--tw-gray-900); }
@media (max-width: 480px) { .opc-pill { flex-wrap: wrap; row-gap: .1rem; gap: .1rem .4rem; max-width: 100%; font-size: .74rem; } }   /* three changes per pill do not fit a phone in one line */
.opc-pill small { color: var(--tw-gray-500); font-size: .7rem; }

/* Controls: the window as a segmented control, the switches beside it. */
.opc-controls { margin-bottom: 1.25rem; }
.opc-win { border: 1px solid var(--opc-line); background: var(--tw-light, #fff); color: var(--tw-gray-700); font-size: .78rem; font-weight: 600; padding: .35rem .7rem; border-radius: .45rem; cursor: pointer; line-height: 1; transition: background-color .12s, border-color .12s, color .12s; }
.opc-win:hover { border-color: var(--opc-blue); }
.opc-win.is-on { background: var(--opc-blue); border-color: var(--opc-blue); color: #fff; }

/* Movers: two panels, one list each, one contract a row. */
.opc-movers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; margin-bottom: 1.25rem; }
.opc-movers[hidden] { display: none !important; }
.opc-movers-card .card-header { min-height: 0; }
.opc-window-name { color: var(--tw-gray-500); font-weight: 500; }
.opc-arrow { font-size: .75rem; margin-right: .2rem; }
.opc-movers-list { list-style: none; margin: 0; padding: 0; }
.opc-mover { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(0, .7fr) minmax(0, .9fr) minmax(0, .7fr) minmax(0, .8fr) minmax(0, .9fr); align-items: center; gap: .4rem .6rem; padding: .45rem 1.1rem; border-top: 1px solid var(--opc-line); font-size: .8rem; font-variant-numeric: tabular-nums; }
.opc-mover:first-child { border-top: 0; }
.opc-mover-name { min-width: 0; line-height: 1.35; }
.opc-mover-name b { font-weight: 600; color: var(--tw-gray-900); }
.opc-mover-name .opc-mover-meta { display: flex; flex-wrap: nowrap; align-items: center; gap: .2rem .35rem; margin-top: .1rem; overflow: hidden; }
.opc-mover-name small { color: var(--tw-gray-500); font-size: .68rem; white-space: nowrap; }
.opc-mover-price { text-align: right; color: var(--tw-gray-900); font-weight: 600; }
.opc-mover-price small { display: block; font-weight: 400; color: var(--tw-gray-500); font-size: .68rem; }
.opc-mover-chg { text-align: right; font-weight: 700; font-size: .95rem; }
.opc-mover-abs { text-align: right; color: var(--tw-gray-700); }
.opc-mover-vol { text-align: right; color: var(--tw-gray-600); }
.opc-mover-vol small, .opc-mover-under small { display: block; font-size: .65rem; color: var(--tw-gray-500); white-space: nowrap; }
.opc-mover-under { text-align: right; color: var(--tw-gray-700); white-space: nowrap; }
.opc-tag { display: inline-block; font-size: .58rem; font-weight: 600; letter-spacing: .03em; padding: .05rem .28rem; border-radius: .25rem; line-height: 1.3; vertical-align: middle; white-space: nowrap; }
.opc-tag--itm { background: rgba(37, 99, 235, .12); color: var(--opc-blue); }
.opc-tag--near { background: rgba(217, 119, 6, .14); color: var(--opc-amber); }
.opc-empty { padding: 1.25rem; color: var(--tw-gray-500); font-size: .8rem; text-align: center; }

/* The table. */
.opc-table-head { display: flex; align-items: center; gap: 1rem; }
.opc-reset { color: var(--opc-blue); text-decoration: underline; text-underline-offset: 3px; }
/* Dense, as the /stocks tape: same row height, type sizes, header labels and sort chevrons. */
.opc-table { width: 100%; font-variant-numeric: tabular-nums; }
/* The /stocks type size by default, scaled by the reader's own setting (--opc-scale); a little more air
   between rows than there, in pixels so it does not follow the type. */
.opc-table { --opc-scale: 1; --opc-pad: 6.6px; --opc-hpad: 5px; }
.opc-table td, .opc-table th { padding-top: var(--opc-pad) !important; padding-bottom: var(--opc-pad) !important; font-size: calc(.78rem * var(--opc-scale)); line-height: 1.25; white-space: nowrap; }
.opc-table td { padding-left: var(--opc-hpad) !important; padding-right: var(--opc-hpad) !important; }
.opc-table th { padding-left: calc(var(--opc-hpad) - 1px) !important; padding-right: calc(var(--opc-hpad) - 1px) !important; }
.opc-table th:first-child { padding-left: calc(var(--opc-hpad) + 3px) !important; }                 /* in line with the symbol below it */
.opc-table th .sort-label { font-size: calc(.68rem * var(--opc-scale)); white-space: nowrap; }
.opc-table th .sort { gap: 2px; }
.opc-table th.is-window .sort-label { color: var(--opc-blue) !important; font-weight: 600 !important; }
.opc-table td:first-child { font-weight: 600; letter-spacing: .01em; padding-left: calc(var(--opc-hpad) + 3px) !important; }
.opc-table td.is-window { background: rgba(37, 99, 235, .06); font-weight: 600; }
.opc-table td.opc-last { font-weight: 600; color: var(--tw-gray-900); }
.opc-table td { transition: background-color .6s ease; }
.opc-table td.opc-tick-up { background: rgba(31, 157, 85, .22); transition: none; }
.opc-table td.opc-tick-down { background: rgba(214, 57, 57, .2); transition: none; }
/* In the money: a bar at the start of the row, not a tint across it. */
.opc-table tr.opc-itm td:first-child { box-shadow: inset 1.5px 0 var(--opc-blue); }
/* Near the strike: a prime after the strike (52′), quiet enough not to pull the eye. */
.opc-near-mark { margin-left: 1px; color: var(--tw-gray-500); font-weight: 600; }
.opc-near-sample { margin-right: .35rem; font-variant-numeric: tabular-nums; color: var(--tw-gray-700); }
.opc-up { color: var(--opc-up); } .opc-down { color: var(--opc-down); } .opc-flat, .opc-na { color: var(--tw-gray-500); }
.opc-table td.opc-quiet { color: var(--tw-gray-400); font-weight: 400; }
.opc-legend { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem 1rem; font-size: .72rem; color: var(--tw-gray-600); padding: .6rem 1.25rem .2rem; }
.opc-swatch { display: inline-block; width: .85rem; height: .85rem; border-radius: .2rem; border: 1px solid var(--opc-line); margin-right: .35rem; vertical-align: middle; }
.opc-swatch--itm { width: 2px; border: 0; border-radius: 1px; background: var(--opc-blue); }
.opc-quiet-sample { color: var(--tw-gray-400); margin-right: .3rem; }
.opc-table td.opc-since-open, .opc-open-sample { text-decoration: underline dotted; text-underline-offset: 3px; text-decoration-color: var(--tw-gray-400); }
.opc-open-sample { margin-right: .3rem; }
.opc-na-sample { color: var(--tw-gray-500); margin-right: .3rem; }

@media (max-width: 1100px) { .opc-mover { grid-template-columns: minmax(0, 1.6fr) minmax(0, .9fr) minmax(0, .8fr) minmax(0, .8fr); } .opc-mover-vol, .opc-mover-under { display: none; } }
@media (max-width: 900px) { .opc-movers { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) { .opc-mover { padding: .45rem .8rem; font-size: .75rem; } .opc-mover-chg { font-size: .85rem; } }

[data-theme-mode="dark"] .opc-page { --opc-up: #4ade80; --opc-down: #f87171; --opc-blue: #60a5fa; --opc-amber: #fbbf24; --opc-line: #2b3648; }
[data-theme-mode="dark"] .opc-pill, [data-theme-mode="dark"] .opc-win { background: transparent; }
[data-theme-mode="dark"] .opc-win.is-on { background: var(--opc-blue); color: #0b1220; }

[data-theme-mode="dark"] .opc-table td.is-window { background: rgba(96, 165, 250, .12); }

[data-theme-mode="dark"] .opc-tag--itm { background: rgba(96, 165, 250, .18); }
[data-theme-mode="dark"] .opc-tag--near { background: rgba(251, 191, 36, .18); }


/* A contract without a trade in the chosen window: greyed, and its price read from the quote where there is one. */
.opc-table tr.opc-stale td { color: var(--tw-gray-500); }
.opc-table tr.opc-stale td.opc-up, .opc-table tr.opc-stale td.opc-down { opacity: .7; }
/* The time of a stale contract's last trade sits beside its price, so every row keeps one line. */
.opc-table td.opc-last small { margin-left: .3rem; font-size: calc(.66rem * var(--opc-scale)); font-weight: 400; color: var(--tw-gray-500); }
.opc-table td.opc-last.is-mid { font-style: italic; }

/* The table's min-content width must not widen the page: only its own scroller may be wider than the screen. */
.opc-table-card { min-width: 0 !important; max-width: 100%; }
/* width 0 + min-width 100 %: the scroller fills its card but contributes nothing to the layout's
   min-content, so the flex columns of the site frame never grow to the table's width. */
.opc-table-card .scrollable-x-auto { width: 0; min-width: 100%; overflow-x: auto; }

#opc-stream.is-idle { color: var(--tw-gray-600, #4b5563); }

/* Hour columns (1H, 2H, 3H) are off unless switched on; the table carries a hide- class per column. */
.opc-table.hide-m60 [data-col="m60"], .opc-table.hide-h2 [data-col="h2"], .opc-table.hide-h3 [data-col="h3"],
.opc-table.hide-lst [data-col="lst"] { display: none; }

/* ---- control panel: four labelled groups - the window, the selection, filters, view ---- */
/* Two rows of two: what is ranked (window, selection) over how it is narrowed and shown (filters, view). */
.opc-bar { display: grid; grid-template-columns: max-content minmax(0, 1fr); padding: 0; }
.opc-group { display: flex; flex-direction: column; gap: .45rem; padding: .7rem 1.1rem; min-width: 0; }
.opc-group:nth-child(even) { border-left: 1px solid var(--opc-line); }
.opc-group:nth-child(n+3) { border-top: 1px solid var(--opc-line); background: color-mix(in srgb, var(--opc-soft) 45%, transparent); }
.opc-group-body { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.opc-search { display: inline-flex; align-items: center; gap: .35rem; height: 1.95rem; padding: 0 .55rem; border: 1px solid var(--opc-line); border-radius: .5rem;
  background: var(--tw-light, #fff); color: var(--tw-gray-500); cursor: text; }
.opc-search:focus-within { border-color: var(--opc-blue); color: var(--opc-blue); }
.opc-search.is-on { border-color: var(--opc-blue); }
.opc-search input { width: 9.5rem; border: 0; outline: 0; background: transparent; font-size: .8rem; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--tw-gray-900); padding: 0; }
.opc-search input::placeholder { text-transform: none; font-weight: 400; letter-spacing: 0; color: var(--tw-gray-500); }
.opc-seg.is-muted { opacity: .45; }
@media (max-width: 640px) { .opc-search { flex: 1 1 100%; } .opc-search input { width: 100%; } }
.opc-cap { font-size: .66rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--tw-gray-500); }

/* A seg wider than its column wraps its buttons rather than cutting them off, and position: relative keeps
   its hidden radios inside the box: left to the page, they gave it a horizontal scrollbar. */
.opc-seg { position: relative; display: inline-flex; flex-wrap: wrap; border: 1px solid var(--opc-line); border-radius: .5rem; overflow: hidden; background: var(--tw-light, #fff); }
.opc-group > .opc-seg { align-self: flex-start; }
.opc-seg > * + * { box-shadow: inset 1px 0 var(--opc-line); }
.opc-seg .opc-win, .opc-seg label > span { display: block; border: 0; border-radius: 0; background: transparent; padding: .34rem .7rem;
  font-size: .78rem; font-weight: 600; color: var(--tw-gray-700); white-space: nowrap; cursor: pointer; line-height: 1.3; }
.opc-seg label { margin: 0; }
.opc-seg input, .opc-chip input { position: absolute; opacity: 0; pointer-events: none; }
.opc-seg .opc-win:hover, .opc-seg label:hover > span { background: var(--opc-soft); }
.opc-seg .opc-win.is-on, .opc-seg input:checked + span { background: var(--opc-blue); color: #fff; }
.opc-seg input:focus-visible + span, .opc-chip input:focus-visible + span { outline: 2px solid var(--opc-blue); outline-offset: -2px; }

.opc-chip { position: relative; margin: 0; }
.opc-chip > span { display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .65rem; border: 1px solid var(--opc-line); border-radius: 999px;
  font-size: .76rem; font-weight: 500; color: var(--tw-gray-700); background: var(--tw-light, #fff); white-space: nowrap; cursor: pointer; line-height: 1.3; }
.opc-chip > span::before { content: ""; width: .7rem; height: .7rem; border-radius: 50%; border: 1.5px solid var(--tw-gray-400); box-sizing: border-box; }
.opc-chip:hover > span { border-color: var(--opc-blue); }
.opc-chip input:checked + span { border-color: var(--opc-blue); background: color-mix(in srgb, var(--opc-blue) 10%, transparent); color: var(--opc-blue); }
.opc-chip input:checked + span::before { border-color: var(--opc-blue); background: var(--opc-blue); box-shadow: inset 0 0 0 2px var(--tw-light, #fff); }
.opc-chip--col > span { font-weight: 600; }

@media (max-width: 900px) {
  .opc-bar { grid-template-columns: minmax(0, 1fr); }
  .opc-group:nth-child(even) { border-left: 0; }
  .opc-group + .opc-group { border-top: 1px solid var(--opc-line); }
  .opc-group--window .opc-seg { width: 100%; align-self: stretch; }
  .opc-group--window .opc-win { flex: 1; text-align: center; padding-left: 0; padding-right: 0; }
}
/* the same single column when the expanded sidebar leaves the content that narrow */
@media (min-width: 1024px) and (max-width: 1100px) {
  body:not(.sidebar-collapse) .opc-bar { grid-template-columns: minmax(0, 1fr); }
  body:not(.sidebar-collapse) .opc-group:nth-child(even) { border-left: 0; }
  body:not(.sidebar-collapse) .opc-group + .opc-group { border-top: 1px solid var(--opc-line); }
}
[data-theme-mode="dark"] .opc-seg, [data-theme-mode="dark"] .opc-chip > span { background: transparent; }
[data-theme-mode="dark"] .opc-seg .opc-win.is-on, [data-theme-mode="dark"] .opc-seg input:checked + span { color: #0b1220; }
[data-theme-mode="dark"] .opc-chip input:checked + span::before { box-shadow: inset 0 0 0 2px #0b1220; }


/* ---- table settings: a button in the View group opening a small popover ---- */
.opc-settings-anchor { position: relative; display: inline-flex; }
.opc-settings-btn { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .7rem; border: 1px solid var(--opc-line); border-radius: 999px;
  background: var(--tw-light, #fff); color: var(--tw-gray-700); font-size: .76rem; font-weight: 500; cursor: pointer; line-height: 1.3; }
.opc-settings-btn:hover, .opc-settings-btn.is-on { border-color: var(--opc-blue); color: var(--opc-blue); }
.opc-settings { position: absolute; z-index: 50; top: calc(100% + .45rem); right: 0; width: 18.5rem; padding: .8rem .9rem .7rem;
  background: var(--tw-light, #fff); border: 1px solid var(--opc-line); border-radius: .75rem; box-shadow: 0 14px 34px rgba(15, 23, 42, .16);
  display: flex; flex-direction: column; gap: .7rem; }
.opc-settings[hidden] { display: none !important; }   /* display: flex above would otherwise override the hidden attribute */
.opc-settings-head { display: flex; align-items: center; justify-content: space-between; font-size: .82rem; color: var(--tw-gray-900); }
.opc-settings-close { border: 0; background: none; font-size: 1.15rem; line-height: 1; color: var(--tw-gray-500); cursor: pointer; padding: 0 .1rem; }
.opc-slider { display: flex; flex-direction: column; gap: .3rem; margin: 0; }
.opc-slider-row { display: flex; justify-content: space-between; font-size: .76rem; color: var(--tw-gray-700); }
.opc-slider-row output { font-variant-numeric: tabular-nums; color: var(--tw-gray-900); font-weight: 600; }
.opc-slider input[type=range] { width: 100%; accent-color: var(--opc-blue); }
.opc-chip--block > span { display: flex; width: 100%; border-radius: .5rem; }
.opc-settings-foot { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--opc-line); padding-top: .55rem; }
.opc-settings-reset { border: 1px solid var(--opc-line); background: none; border-radius: .45rem; padding: .25rem .6rem; font-size: .74rem; color: var(--tw-gray-700); cursor: pointer; }
.opc-settings-reset:hover { border-color: var(--opc-blue); color: var(--opc-blue); }
@media (max-width: 900px) { .opc-settings { right: auto; left: 0; width: min(18.5rem, calc(100vw - 3rem)); } }
[data-theme-mode="dark"] .opc-settings { background: var(--tw-coal-500, #1e1e2d); box-shadow: 0 14px 34px rgba(0, 0, 0, .5); }
[data-theme-mode="dark"] .opc-settings-btn { background: transparent; }

/* the settings' effects on the table */
.opc-table.no-lines td, .opc-table.no-lines th { border-inline-end-color: transparent !important; }
.opc-table.is-zebra tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--opc-soft) 70%, transparent); }
.opc-table.plain-last td.opc-last { font-weight: 500; }

/* Explicit price units and the timestamps of the two minute bars. */
.opc-window-rule { grid-column: 1 / -1; margin: 0; font-size: .75rem; line-height: 1.45; color: var(--tw-gray-600); }
.opc-window-rule:empty { display: none; }
.opc-mover-name .opc-mover-interval { display: block; white-space: normal; font-size: .63rem; margin-top: .15rem; }
.opc-mover-abs small { display: block; font-size: .6rem; color: var(--tw-gray-500); font-weight: 400; overflow-wrap: anywhere; }
.opc-movers-card .card-header { flex-wrap: wrap; gap: .25rem; }

/* ---- table settings: a column chooser, for a page with more columns than a reader needs at once ---- */
.opc-settings--wide { width: 21rem; max-height: min(78vh, 40rem); overflow-y: auto; }
.opc-settings-cap { border-top: 1px solid var(--opc-line); padding-top: .55rem; font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--tw-gray-500); }
.opc-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .3rem .5rem; }
.opc-check { display: inline-flex; align-items: center; gap: .4rem; margin: 0; font-size: .76rem; color: var(--tw-gray-700); cursor: pointer; white-space: nowrap; }
.opc-check input { accent-color: var(--opc-blue); }
@media (max-width: 900px) { .opc-settings--wide { width: min(21rem, calc(100vw - 3rem)); } }
