:root {
  --oc-bg: #121212;
  --oc-panel: #1b1b1b;
  --oc-panel-2: #252525;
  --oc-line: rgba(255, 255, 255, 0.08);
  --oc-line-strong: rgba(255, 255, 255, 0.14);
  --oc-text: #f2f5f7;
  --oc-muted: #989ea0;
  --oc-ce: #4caf50;
  --oc-ce-soft: rgba(76, 175, 80, 0.08);
  --oc-ce-hover: rgba(76, 175, 80, 0.14);
  --oc-ce-sel: rgba(76, 175, 80, 0.2);
  --oc-pe: #ff5e3b;
  --oc-pe-soft: rgba(255, 94, 59, 0.08);
  --oc-pe-hover: rgba(255, 94, 59, 0.16);
  --oc-pe-sel: rgba(255, 94, 59, 0.24);
  --oc-atm: #989ea0;
  --oc-live: #4caf50;
  --oc-font: "Plus Jakarta Sans", "Segoe UI", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --oc-accent: #4caf50;
  --oc-up: #4caf50;
  --oc-down: #ff5e3b;
}

.cx-shell.theme-light,
html.theme-light {
  --oc-bg: #ffffff;
  --oc-panel: #ffffff;
  --oc-panel-2: #f7f8f9;
  --oc-line: #eef0f2;
  --oc-line-strong: #e2e5e8;
  --oc-text: #1a1d1f;
  --oc-muted: #6b7280;
  /* Same candle green — soft chrome, solid only for CE/up price */
  --oc-ce: #4caf50;
  --oc-ce-soft: transparent;
  --oc-ce-hover: rgba(76, 175, 80, 0.08);
  --oc-ce-sel: rgba(76, 175, 80, 0.14);
  --oc-pe: #b91c1c;
  --oc-pe-soft: transparent;
  --oc-pe-hover: #fef2f2;
  --oc-pe-sel: #fecaca;
  --oc-atm: #4b5563;
  --oc-live: #4caf50;
  --oc-accent: #4caf50;
  --oc-up: #4caf50;
  --oc-down: #dc2626;
}

.oc-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--oc-bg);
  color: var(--oc-text);
  font-family: var(--oc-font);
  overflow: hidden;
  min-height: 0;
}

.oc-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--oc-line);
  background: linear-gradient(180deg, var(--oc-panel-2) 0%, var(--oc-panel) 100%);
  flex-wrap: wrap;
  flex-shrink: 0;
  position: relative;
  z-index: 20;
}

.oc-brand {
  color: var(--oc-text);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.02em;
  font-size: 14px;
}
.oc-brand span {
  color: var(--oc-muted);
  font-weight: 500;
  margin-left: 6px;
  font-size: 12px;
}

.oc-top select,
.oc-top button {
  background: var(--oc-panel-2);
  color: var(--oc-text);
  border: 1px solid var(--oc-line-strong);
  border-radius: 7px;
  padding: 6px 10px;
  font-size: 12.5px;
  font-family: inherit;
}
.oc-top button { cursor: pointer; }
.oc-top button:hover { border-color: var(--oc-muted); background: var(--oc-panel-2); }

.oc-meta {
  display: flex;
  gap: 12px;
  align-items: baseline;
  font-size: 12.5px;
  color: var(--oc-muted);
  flex-wrap: wrap;
}
.oc-meta b {
  color: var(--oc-text);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.oc-live[data-state="ok"] { color: var(--oc-up); }
.oc-live[data-state="bad"] { color: var(--oc-down); }
.oc-live[data-state="wait"] { color: var(--oc-muted); }

.oc-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  font-size: 11.5px;
  color: var(--oc-muted);
  background: var(--oc-panel-2);
  border-bottom: 1px solid var(--oc-line);
  letter-spacing: 0.01em;
  flex-shrink: 0;
  position: relative;
  z-index: 19;
}
.oc-hint strong {
  color: var(--oc-text);
  font-weight: 600;
}
.oc-hint .oc-hint-ce { color: var(--oc-ce); font-weight: 700; }
.oc-hint .oc-hint-pe { color: var(--oc-pe); font-weight: 700; }
.oc-hint-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--oc-muted);
  flex-shrink: 0;
}

.oc-body {
  flex: 1;
  overflow: auto;
  min-height: 0;
  background: var(--oc-bg);
}

/* ── Table ─────────────────────────────────────────────── */
table.oc {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  table-layout: fixed;
}

table.oc th,
table.oc td {
  padding: 5px 7px;
  border-bottom: 1px solid var(--oc-line);
  text-align: right;
  white-space: nowrap;
  vertical-align: middle;
}

/* Sticky table header — fully opaque (no rgba) so scrolled rows never bleed through */
table.oc thead {
  position: sticky;
  top: 0;
  z-index: 8;
  background-color: var(--oc-panel);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.55);
}
table.oc thead tr {
  background-color: var(--oc-panel);
}
table.oc thead th {
  position: relative;
  top: auto;
  z-index: 5;
  background-color: var(--oc-panel) !important;
  color: var(--oc-muted);
  font-weight: 650;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--oc-line-strong);
  background-clip: padding-box;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
table.oc thead tr.oc-head-group th {
  top: auto;
  padding: 7px 8px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-align: center;
  border-bottom: none;
}
table.oc thead tr.oc-head-cols th {
  top: auto;
  padding-top: 4px;
  padding-bottom: 6px;
}
table.oc thead th.oc-g-ce {
  background-color: #0c2e22 !important;
  color: var(--oc-ce);
  border-bottom: 2px solid rgba(4, 180, 136, 0.45);
}
table.oc thead th.oc-g-pe {
  background-color: #391810 !important;
  color: var(--oc-pe);
  border-bottom: 2px solid rgba(255, 94, 59, 0.45);
}
table.oc thead th.oc-g-strike {
  background-color: #1e2224 !important;
  color: var(--oc-muted);
  border-bottom: 2px solid rgba(255, 255, 255, 0.12);
  width: 88px;
}
table.oc thead th.ce {
  color: var(--oc-ce);
  background-color: #0f251d !important;
}
table.oc thead th.pe {
  color: var(--oc-pe);
  background-color: #2c1711 !important;
}
table.oc thead th.oc-th-strike {
  text-align: center;
  color: var(--oc-muted);
  background-color: #1e2224 !important;
  width: 88px;
}

html.theme-light table.oc thead th.oc-g-ce,
.cx-shell.theme-light table.oc thead th.oc-g-ce {
  background-color: #ffffff !important;
  color: var(--oc-ce);
  border-bottom: 2px solid var(--oc-ce);
}
html.theme-light table.oc thead th.oc-g-pe,
.cx-shell.theme-light table.oc thead th.oc-g-pe {
  background-color: #ffffff !important;
  color: #b91c1c;
  border-bottom: 2px solid #b91c1c;
}
html.theme-light table.oc thead th.oc-g-strike,
html.theme-light table.oc thead th.oc-th-strike,
.cx-shell.theme-light table.oc thead th.oc-g-strike,
.cx-shell.theme-light table.oc thead th.oc-th-strike {
  background-color: #f7f8f9 !important;
  color: #6b7280 !important;
  border-bottom: 2px solid #d1d5db;
}
html.theme-light table.oc thead th.ce,
.cx-shell.theme-light table.oc thead th.ce,
html.theme-light table.oc thead th.pe,
.cx-shell.theme-light table.oc thead th.pe {
  background-color: #ffffff !important;
  color: #6b7280 !important;
  border-bottom-color: #e2e5e8;
}

/* Light: neutral data ink — green/red only on chg */
html.theme-light table.oc td.ce,
.cx-shell.theme-light table.oc td.ce,
html.theme-light table.oc td.pe,
.cx-shell.theme-light table.oc td.pe {
  color: #1a1d1f !important;
  background: #ffffff !important;
}
html.theme-light table.oc td.oc-ltp .oc-ltp-main,
.cx-shell.theme-light table.oc td.oc-ltp .oc-ltp-main {
  color: #111827 !important;
  font-weight: 700;
}
html.theme-light table.oc .oc-chg.up,
html.theme-light table.oc .oc-ltp-chg.up,
.cx-shell.theme-light table.oc .oc-chg.up,
.cx-shell.theme-light table.oc .oc-ltp-chg.up {
  color: #059669 !important;
}
html.theme-light table.oc .oc-chg.dn,
html.theme-light table.oc .oc-ltp-chg.dn,
.cx-shell.theme-light table.oc .oc-chg.dn,
.cx-shell.theme-light table.oc .oc-ltp-chg.dn {
  color: #dc2626 !important;
}
html.theme-light table.oc .oc-chg.flat,
html.theme-light table.oc .oc-ltp-chg.flat,
.cx-shell.theme-light table.oc .oc-chg.flat,
.cx-shell.theme-light table.oc .oc-ltp-chg.flat {
  color: #9ca3af !important;
}

/* Subtle ITM wash (row tint only, not neon text) */
html.theme-light table.oc tr.is-itm-ce td.ce,
.cx-shell.theme-light table.oc tr.is-itm-ce td.ce {
  background: #f8fffc !important;
}
html.theme-light table.oc tr.is-itm-pe td.pe,
.cx-shell.theme-light table.oc tr.is-itm-pe td.pe {
  background: #fffafa !important;
}

html.theme-light table.oc thead,
.cx-shell.theme-light table.oc thead {
  box-shadow: 0 1px 0 #e2e5e8;
}
html.theme-light .oc-top,
.cx-shell.theme-light .oc-top {
  background: #ffffff;
  border-bottom-color: #eef0f2;
}
html.theme-light .oc-hint,
.cx-shell.theme-light .oc-hint {
  background: #f7f8f9;
  color: #6b7280;
  border-bottom-color: #eef0f2;
}
html.theme-light .oc-top select,
.cx-shell.theme-light .oc-top select {
  background: #ffffff;
  border-color: #e2e5e8;
  color: #1a1d1f;
  border-radius: 8px;
}
html.theme-light .oc-top button,
.cx-shell.theme-light .oc-top button {
  background: #ffffff;
  border-color: #e2e5e8;
  color: #1a1d1f;
  border-radius: 8px;
}
html.theme-light .oc-top button[data-oc-refresh],
.cx-shell.theme-light .oc-top button[data-oc-refresh] {
  background: rgba(76, 175, 80, 0.12);
  border-color: rgba(76, 175, 80, 0.35);
  color: var(--oc-accent);
  font-weight: 700;
}
html.theme-light .oc-top button:hover,
.cx-shell.theme-light .oc-top button:hover {
  background: rgba(76, 175, 80, 0.08);
  border-color: rgba(76, 175, 80, 0.4);
  color: var(--oc-ce);
}
html.theme-light .oc-top button[data-oc-refresh]:hover,
.cx-shell.theme-light .oc-top button[data-oc-refresh]:hover {
  background: rgba(76, 175, 80, 0.18);
  border-color: rgba(76, 175, 80, 0.45);
  color: var(--oc-accent);
}
.oc-top button[data-oc-refresh] {
  background: rgba(76, 175, 80, 0.14);
  border-color: rgba(76, 175, 80, 0.4);
  color: var(--oc-accent);
  font-weight: 700;
}
.oc-top button[data-oc-refresh]:hover {
  background: rgba(76, 175, 80, 0.22);
  color: var(--oc-accent);
}
html.theme-light .oc-modal,
.cx-shell.theme-light .oc-modal {
  background: #ffffff;
  border-color: #e2e5e8;
  box-shadow: 0 24px 64px rgba(17, 24, 39, 0.16);
  border-radius: 12px;
}
html.theme-light .oc-modal-backdrop,
.cx-shell.theme-light .oc-modal-backdrop {
  background: rgba(17, 24, 39, 0.45);
}
html.theme-light td.ce .oc-oi-bar,
.cx-shell.theme-light td.ce .oc-oi-bar {
  background: linear-gradient(90deg, rgba(5, 150, 105, 0.28), rgba(5, 150, 105, 0.06));
  opacity: 0.7;
}
html.theme-light td.pe .oc-oi-bar,
.cx-shell.theme-light td.pe .oc-oi-bar {
  background: linear-gradient(270deg, rgba(220, 38, 38, 0.28), rgba(220, 38, 38, 0.06));
  opacity: 0.7;
}
html.theme-light td.ce .oc-chart-cue,
.cx-shell.theme-light td.ce .oc-chart-cue {
  color: var(--oc-ce);
  background: rgba(255, 255, 255, 0.95);
  border-color: #99f6e4;
}
html.theme-light td.pe .oc-chart-cue,
.cx-shell.theme-light td.pe .oc-chart-cue {
  color: #b91c1c;
  background: rgba(255, 255, 255, 0.95);
  border-color: #fecaca;
}

html.theme-light table.oc tr.is-atm td.ce,
.cx-shell.theme-light table.oc tr.is-atm td.ce {
  background: #f0fdfa !important;
}
html.theme-light table.oc tr.is-atm td.pe,
.cx-shell.theme-light table.oc tr.is-atm td.pe {
  background: #fef2f2 !important;
}
html.theme-light table.oc tr.is-atm td.strike,
.cx-shell.theme-light table.oc tr.is-atm td.strike {
  background: #f3f4f6 !important;
  box-shadow: none !important;
  border-left: 2px solid #9ca3af !important;
  border-right: 2px solid #9ca3af !important;
  color: #374151 !important;
}
html.theme-light table.oc tr.is-hover-ce td.ce,
html.theme-light table.oc tr:has(td.ce.oc-click:hover) td.ce,
.cx-shell.theme-light table.oc tr.is-hover-ce td.ce,
.cx-shell.theme-light table.oc tr:has(td.ce.oc-click:hover) td.ce {
  background: #f0fdfa !important;
  box-shadow: inset 0 0 0 1px #99f6e4;
}
html.theme-light table.oc tr.is-hover-pe td.pe,
html.theme-light table.oc tr:has(td.pe.oc-click:hover) td.pe,
.cx-shell.theme-light table.oc tr.is-hover-pe td.pe,
.cx-shell.theme-light table.oc tr:has(td.pe.oc-click:hover) td.pe {
  background: #fef2f2 !important;
  box-shadow: inset 0 0 0 1px #fecaca;
}
html.theme-light table.oc tr.is-sel-ce td.ce,
.cx-shell.theme-light table.oc tr.is-sel-ce td.ce {
  background: #ccfbf1 !important;
  box-shadow: inset 0 0 0 1px #14b8a6;
}
html.theme-light table.oc tr.is-sel-pe td.pe,
.cx-shell.theme-light table.oc tr.is-sel-pe td.pe {
  background: #fecaca !important;
  box-shadow: inset 0 0 0 1px #ef4444;
}

/* Body cells — soft half tints */
table.oc td.ce {
  color: var(--oc-ce);
  background: var(--oc-ce-soft);
}
table.oc td.pe {
  color: var(--oc-pe);
  background: var(--oc-pe-soft);
}
table.oc td.oc-click {
  cursor: pointer;
  transition: background 0.12s ease, box-shadow 0.12s ease;
  position: relative;
}
table.oc td.oc-click:active {
  filter: brightness(1.08);
}

/* Center Strike column — not sticky-left (that was for a left rail and breaks CE|Strike|PE) */
table.oc td.strike,
table.oc td.strike .oc-strike-val {
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  background: var(--oc-panel-2);
  color: var(--oc-text);
  position: static;
  left: auto;
  z-index: auto;
  cursor: pointer;
  width: 92px;
  min-width: 92px;
  border-left: 1px solid var(--oc-line-strong);
  border-right: 1px solid var(--oc-line-strong);
  box-shadow: none;
}
table.oc td.strike .oc-strike-val {
  display: block;
  color: inherit;
  background: transparent;
  font-size: 12.5px;
  font-weight: 750;
}
html.theme-light table.oc td.strike,
.cx-shell.theme-light table.oc td.strike {
  background: #f3f4f6 !important;
  color: #111827 !important;
  border-left-color: #d1d5db;
  border-right-color: #d1d5db;
  box-shadow: none !important;
}
html.theme-light table.oc td.strike .oc-strike-val,
.cx-shell.theme-light table.oc td.strike .oc-strike-val {
  color: #111827 !important;
  background: transparent !important;
}
table.oc thead th.oc-th-strike,
table.oc thead th.oc-g-strike {
  position: static;
  left: auto;
  z-index: 5;
  background-color: var(--oc-panel-2) !important;
  text-align: center;
  width: 92px;
  min-width: 92px;
  box-shadow: none;
}
html.theme-light table.oc thead th.oc-th-strike,
html.theme-light table.oc thead th.oc-g-strike,
.cx-shell.theme-light table.oc thead th.oc-th-strike,
.cx-shell.theme-light table.oc thead th.oc-g-strike {
  background-color: #f3f4f6 !important;
  color: #6b7280 !important;
  border-left: 1px solid #d1d5db;
  border-right: 1px solid #d1d5db;
}
.oc-strike-inner {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  line-height: 1.2;
  width: 100%;
}
.oc-atm-chip {
  display: inline-block;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(4, 180, 136, 0.18);
  color: #46d5a7;
  border: 1px solid rgba(4, 180, 136, 0.35);
}
html.theme-light .oc-atm-chip,
.cx-shell.theme-light .oc-atm-chip {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

/* ATM row */
table.oc tr.is-atm td.ce { background: rgba(4, 180, 136, 0.12); }
table.oc tr.is-atm td.pe { background: rgba(255, 94, 59, 0.12); }
table.oc tr.is-atm td.strike {
  background: rgba(4, 180, 136, 0.14);
  box-shadow: none;
  color: var(--oc-text);
  border-left-color: rgba(4, 180, 136, 0.45);
  border-right-color: rgba(4, 180, 136, 0.45);
}
html.theme-light table.oc tr.is-atm td.ce,
.cx-shell.theme-light table.oc tr.is-atm td.ce {
  background: #f0fdfa !important;
}
html.theme-light table.oc tr.is-atm td.pe,
.cx-shell.theme-light table.oc tr.is-atm td.pe {
  background: #fef2f2 !important;
}
html.theme-light table.oc tr.is-atm td.strike,
.cx-shell.theme-light table.oc tr.is-atm td.strike {
  background: #f3f4f6 !important;
  box-shadow: none !important;
  border-left: 2px solid #9ca3af !important;
  border-right: 2px solid #9ca3af !important;
  color: #374151 !important;
}
html.theme-light table.oc tr.is-atm td.strike .oc-strike-val,
.cx-shell.theme-light table.oc tr.is-atm td.strike .oc-strike-val {
  color: #111827 !important;
  font-weight: 800;
}
table.oc td.strike:hover {
  filter: brightness(1.06);
}

/* Half-row hover (JS class + :has fallback) */
table.oc tr.is-hover-ce td.ce,
table.oc tr:has(td.ce.oc-click:hover) td.ce {
  background: var(--oc-ce-hover);
  box-shadow: inset 0 0 0 1px rgba(4, 180, 136, 0.28);
}
table.oc tr.is-hover-pe td.pe,
table.oc tr:has(td.pe.oc-click:hover) td.pe {
  background: var(--oc-pe-hover);
  box-shadow: inset 0 0 0 1px rgba(255, 94, 59, 0.28);
}
table.oc tr.is-hover-ce td.ce .oc-chart-cue,
table.oc tr:has(td.ce.oc-click:hover) td.ce .oc-chart-cue,
table.oc tr.is-hover-pe td.pe .oc-chart-cue,
table.oc tr:has(td.pe.oc-click:hover) td.pe .oc-chart-cue {
  opacity: 1;
  transform: translateY(0);
}

/* Selection after click */
table.oc tr.is-sel-ce td.ce {
  background: var(--oc-ce-sel);
  box-shadow: inset 0 0 0 1px rgba(4, 180, 136, 0.5);
}
table.oc tr.is-sel-pe td.pe {
  background: var(--oc-pe-sel);
  box-shadow: inset 0 0 0 1px rgba(255, 94, 59, 0.5);
}

/* LTP + chart cue */
table.oc td.oc-ltp {
  font-weight: 700;
  min-width: 72px;
}
.oc-ltp-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  position: relative;
  padding-right: 0;
  transition: padding-right 0.15s ease;
}
table.oc tr.is-hover-ce td.ce .oc-ltp-wrap,
table.oc tr:has(td.ce.oc-click:hover) td.ce .oc-ltp-wrap,
table.oc tr.is-hover-pe td.pe .oc-ltp-wrap,
table.oc tr:has(td.pe.oc-click:hover) td.pe .oc-ltp-wrap {
  padding-right: 0;
}
.oc-ltp-main { font-size: 12.5px; color: inherit; }
.oc-ltp-chg {
  font-size: 10.5px;
  font-weight: 700;
  opacity: 1;
}
.oc-ltp-chg.up { color: var(--oc-up); }
.oc-ltp-chg.dn { color: var(--oc-down); }
.oc-ltp-chg.flat { color: var(--oc-muted); }
table.oc td.oc-chg.up { color: var(--oc-up); font-weight: 700; }
table.oc td.oc-chg.dn { color: var(--oc-down); font-weight: 700; }
table.oc td.oc-chg.flat { color: var(--oc-muted); }

.oc-chart-cue {
  position: absolute;
  left: 4px;
  top: 3px;
  transform: translateY(-2px);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.02em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s ease, transform 0.14s ease;
  white-space: nowrap;
  z-index: 2;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(7, 11, 20, 0.82);
}
td.ce .oc-chart-cue {
  color: var(--oc-ce);
  border: 1px solid rgba(4, 180, 136, 0.35);
}
td.pe .oc-chart-cue {
  color: var(--oc-pe);
  border: 1px solid rgba(255, 94, 59, 0.35);
}
.oc-chart-cue svg {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
  opacity: 0.95;
}
table.oc tr.is-hover-ce td.ce.oc-ltp,
table.oc tr:has(td.ce.oc-click:hover) td.ce.oc-ltp,
table.oc tr.is-hover-pe td.pe.oc-ltp,
table.oc tr:has(td.pe.oc-click:hover) td.pe.oc-ltp {
  padding-top: 16px;
}

/* OI bars */
table.oc td.oc-oi {
  position: relative;
  overflow: hidden;
  min-width: 70px;
}
.oc-oi-bar {
  position: absolute;
  top: 15%;
  bottom: 15%;
  border-radius: 2px;
  pointer-events: none;
  opacity: 0.55;
  max-width: 96%;
}
td.ce .oc-oi-bar {
  left: 0;
  background: linear-gradient(90deg, rgba(4, 180, 136, 0.55), rgba(4, 180, 136, 0.12));
}
td.pe .oc-oi-bar {
  right: 0;
  background: linear-gradient(270deg, rgba(255, 94, 59, 0.55), rgba(255, 94, 59, 0.12));
}
.oc-oi-val {
  position: relative;
  z-index: 1;
  font-weight: 650;
}

.oc-chg.up { color: var(--oc-up); }
.oc-chg.dn { color: var(--oc-down); }
.oc-chg.flat { color: var(--oc-muted); }

table.oc td.flash-up { animation: ocFlashUp 0.35s ease; }
table.oc td.flash-dn { animation: ocFlashDn 0.35s ease; }
@keyframes ocFlashUp { from { background: rgba(4, 180, 136, 0.4); } to { background: transparent; } }
@keyframes ocFlashDn { from { background: rgba(255, 94, 59, 0.4); } to { background: transparent; } }

.oc-empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--oc-muted);
  font-size: 14px;
}

/* Modal overlay on charts */
.oc-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 12000;
  background: rgba(18, 18, 18, 0.72);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.oc-modal-backdrop[hidden] { display: none !important; }
.oc-modal {
  width: min(1180px, 97vw);
  height: min(82vh, 860px);
  background: var(--oc-bg);
  border: 1px solid var(--oc-line-strong);
  border-radius: 14px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.oc-modal .oc-shell { height: 100%; }
.oc-modal .oc-top { border-radius: 14px 14px 0 0; }
.oc-modal table.oc { font-size: 11.5px; }
.oc-modal table.oc th,
.oc-modal table.oc td { padding: 4px 6px; }

html,
body.oc-page {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--oc-bg);
}

@media (max-width: 900px) {
  table.oc { font-size: 11px; table-layout: auto; }
  .oc-chart-cue { display: none; }
  .oc-hint { font-size: 11px; }
}
@media (max-width: 640px) {
  .oc-modal-backdrop {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  }
  .oc-modal {
    width: 100%;
    height: 100%;
    max-height: none;
    border-radius: 0;
    border: 0;
  }
  .oc-modal .oc-top {
    border-radius: 0;
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    grid-template-areas:
      "brand brand close"
      "under expiry refresh"
      "meta meta meta";
    gap: 0.4rem 0.45rem;
    padding: 0.55rem 0.65rem 0.5rem;
    align-items: center;
  }
  .oc-modal .oc-brand {
    grid-area: brand;
    font-size: 13px;
  }
  .oc-modal .oc-brand span { display: none; }
  .oc-modal .oc-top [data-oc-under] { grid-area: under; width: 100%; min-width: 0; }
  .oc-modal .oc-top [data-oc-expiry] { grid-area: expiry; width: 100%; min-width: 0; }
  .oc-modal .oc-top [data-oc-refresh] { grid-area: refresh; white-space: nowrap; }
  .oc-modal .oc-top [data-oc-close] {
    grid-area: close;
    margin-left: 0 !important;
    justify-self: end;
    min-width: 36px;
    padding: 6px 8px;
  }
  .oc-modal .oc-meta {
    grid-area: meta;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    font-size: 0.7rem;
    padding-top: 0.15rem;
    border-top: 1px solid var(--oc-line);
  }
  .oc-modal .oc-meta span {
    white-space: nowrap;
  }
  .oc-hint {
    display: none;
  }
  .oc-head-group-desk { display: none !important; }
  .oc-head-group-mob { display: table-row !important; }
  /* Mobile core: LTP Vol OI | Strike | OI Vol LTP */
  table.oc .oc-col-desk,
  table.oc .oc-col-extra {
    display: none !important;
  }
  .oc-body {
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  table.oc {
    table-layout: fixed;
    font-size: 11px;
    width: 100%;
    min-width: 360px;
  }
  table.oc th,
  table.oc td {
    padding: 7px 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  table.oc .oc-oi-val,
  table.oc td[data-k$=".volume"] {
    font-variant-numeric: tabular-nums;
    font-size: 10.5px;
    letter-spacing: -0.02em;
  }
  table.oc thead th.ce,
  table.oc thead th.pe,
  table.oc td.ce,
  table.oc td.pe {
    width: 14%;
  }
  table.oc thead th.oc-th-strike,
  table.oc td.strike {
    width: 16%;
  }
  table.oc .oc-chart-cue {
    display: none !important;
  }
  table.oc td.strike,
  table.oc thead th.oc-th-strike {
    position: sticky;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    background: var(--oc-panel) !important;
  }
  table.oc thead th.oc-th-strike {
    z-index: 6;
  }
  /* Sticky center strike without transform (more reliable) */
  table.oc td.strike,
  table.oc thead th.oc-th-strike {
    left: auto;
    transform: none;
    box-shadow: inset 1px 0 0 var(--oc-line-strong), inset -1px 0 0 var(--oc-line-strong);
  }
  .oc-ltp-wrap {
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
  }
  .oc-ltp-main {
    font-size: 11px;
    font-weight: 700;
  }
  .oc-ltp-chg {
    font-size: 9px;
  }
  .oc-oi-bar {
    opacity: 0.35;
  }
}
.oc-head-group-mob {
  display: none;
}
