/* /volatility/deep-itm: the section's shared rules (volatility.css) on the site's own Metronic tokens (--tw-*), so the
   page follows pogosov.com in both themes: white cards on the light page, coal cards on the dark one. */
body > .flex.grow, body > .flex.grow > .wrapper { min-width: 0; }

.vol-page.vol-deep-itm {
  --vol-ink: var(--tw-gray-900); --vol-muted: var(--tw-gray-600); --vol-line: var(--tw-gray-200);
  --vol-bg: var(--tw-card-background-color); --vol-soft: var(--tw-gray-100); --vol-blue: var(--tw-primary-active);
  --vdi-ink-2: var(--tw-gray-700);
  /* chart chrome and marks; the script reads these, so the chart follows the theme too.  Call and Put were
     validated as a pair on both surfaces (red-green colour blindness included). */
  --vdi-text: var(--tw-gray-600); --vdi-grid: var(--tw-gray-100); --vdi-axis: var(--tw-gray-300);
  --vdi-price: var(--tw-gray-900); --vdi-call: #16a34a; --vdi-put: #be123c; --vdi-band: var(--tw-gray-500);
  --vdi-night: rgba(100, 116, 139, .09);
  --vdi-up-text: #15803d; --vdi-down-text: #be123c;
}
.dark .vol-page.vol-deep-itm {
  --vdi-call: #19b036; --vdi-put: #d02940; --vdi-night: rgba(148, 163, 184, .07);
  --vdi-up-text: #4ade80; --vdi-down-text: #f87171;
}
.vol-deep-itm .vol-up { color: var(--vdi-up-text); }
.vol-deep-itm .vol-down { color: var(--vdi-down-text); }

/* Heading and tabs, as on the other tabs of the section: every tab on a wide screen, a sideways row on a phone. */
.vol-deep-itm .vol-heading { margin-bottom: 14px; }
.vol-deep-itm .vol-heading h1 { margin-bottom: 6px; }
.vol-deep-itm .vol-heading .vol-muted { max-width: 880px; }
.vol-deep-itm .vol-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 2px; margin-top: 18px; }
.vol-deep-itm .vol-tabs::-webkit-scrollbar { display: none; }
.vol-deep-itm .vol-tabs a { white-space: nowrap; padding: 10px 13px; font-size: 13px; font-weight: 500; min-height: 40px; color: var(--vdi-ink-2); }
.vol-deep-itm .vol-tabs a:hover { color: var(--vol-ink); }
.vol-deep-itm .vol-tabs a.is-active { color: var(--tw-primary); border-color: var(--tw-primary); }
@media (min-width: 901px) { .vol-deep-itm .vol-tabs { flex-wrap: wrap; overflow-x: visible; } }
.vol-deep-itm section, .vol-deep-itm details { scroll-margin-top: 85px; }

/* Every block is a site card. */
.vol-deep-itm .vdi-controls, .vol-deep-itm .vol-panel, .vol-deep-itm .vol-method, .vol-deep-itm .vdi-card {
  background: var(--tw-card-background-color); border: var(--tw-card-border); border-radius: .75rem; box-shadow: var(--tw-card-box-shadow);
}

/* The form: one row of fields above everything it scopes. */
.vdi-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 14px; margin: 18px 0 16px; padding: 14px 16px; }
.vdi-controls label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 500; color: var(--vol-muted); min-width: 0; }
.vdi-controls select {
  appearance: auto; min-height: 36px; max-width: 100%; padding: 6px 10px; border-radius: .5rem; font-size: 13px;
  color: var(--vol-ink); background: var(--tw-card-background-color); border: 1px solid var(--tw-gray-300);
}
.vdi-controls select:focus-visible { outline: 2px solid var(--tw-primary); outline-offset: 1px; }
.vdi-controls .btn { min-height: 36px; }

/* The chart card. */
.vdi-chart-panel .vol-panel-title { padding-bottom: 8px; }
.vdi-chart-panel .vol-panel-title > span { font-size: 12px; }
.vdi-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; list-style: none; margin: 0; padding: 0 17px 8px; font-size: 12px; color: var(--vdi-ink-2); }
.vdi-legend li { display: inline-flex; align-items: center; gap: 7px; }
.vdi-key { display: inline-block; flex: none; width: 18px; height: 0; border-top: 2px solid var(--vdi-price); vertical-align: middle; }
.vdi-key--call { border-top-color: var(--vdi-call); }
.vdi-key--put { border-top-color: var(--vdi-put); }
.vdi-key--thin { opacity: .55; }
.vdi-key--night { border-top: 2px dashed var(--vdi-band); }
.vdi-key--dash { border-top-style: dashed; }
.vdi-readout {
  display: flex; flex-wrap: wrap; gap: 4px 14px; min-height: 42px; margin: 0; padding: 8px 17px; font-size: 12px; line-height: 1.5;
  color: var(--vdi-ink-2); background: var(--tw-gray-100); border-top: 1px solid var(--vol-line); border-bottom: 1px solid var(--vol-line);
  font-variant-numeric: tabular-nums;
}
.vdi-readout-time { font-weight: 600; color: var(--vol-ink); }
.vdi-readout-price { font-weight: 600; color: var(--vol-ink); }
.vdi-readout-night { color: var(--vol-muted); }
.vdi-readout-side { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.vdi-readout .vdi-in { color: var(--vdi-up-text); font-weight: 600; }
.vdi-readout .vdi-out { color: var(--vol-muted); }
.vdi-chart { position: relative; height: 380px; margin: 8px 6px 0 10px; }
.vdi-chart--over { height: 150px; margin-top: 0; }
.vdi-chart-caption { margin: 12px 17px 0; font-size: 12px; font-weight: 500; color: var(--vdi-ink-2); }
.vdi-chart-panel .vol-panel-note { padding-top: 10px; }

/* The night: one card per side. */
.vdi-nights { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 16px; margin: 18px 0; }
.vdi-card { padding: 16px 18px; min-width: 0; }
.vdi-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.vdi-card h3 { display: inline-flex; align-items: center; gap: 9px; margin: 0; font-size: 15px; font-weight: 600; color: var(--vol-ink); }
.vdi-badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.vdi-badge.is-in { color: var(--vdi-up-text); background: color-mix(in srgb, var(--vdi-call) 12%, transparent); }
.vdi-badge.is-out { color: var(--vdi-ink-2); background: var(--tw-gray-100); }
.vdi-contract { margin: 8px 0 12px; font-size: 13px; font-weight: 500; color: var(--vdi-ink-2); font-variant-numeric: tabular-nums; }
.vdi-steps { display: grid; gap: 8px; margin: 0 0 14px; font-size: 13px; line-height: 1.55; }
.vdi-steps > div { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 10px; }
.vdi-steps dt { font-weight: 600; color: var(--vol-ink); }
.vdi-steps dd { margin: 0; color: var(--vdi-ink-2); font-variant-numeric: tabular-nums; }
.vdi-muted { color: var(--vol-muted); }
.vdi-result { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.vdi-result > div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: .6rem; background: var(--tw-gray-100); min-width: 0; }
.vdi-result span { font-size: 11px; color: var(--vol-muted); }
.vdi-result b { font-size: 17px; font-weight: 600; color: var(--vol-ink); }
.vdi-result small { font-size: 11px; color: var(--vol-muted); overflow-wrap: anywhere; }
.vdi-result-main { box-shadow: inset 0 0 0 1px var(--tw-gray-300); }
.vdi-note { margin: 10px 0 12px; font-size: 12px; line-height: 1.55; color: var(--vol-muted); }

/* Tables: the moments, the morning exits and every night; a phone scrolls them inside their card. */
.vdi-scroll { overflow-x: auto; }
.vdi-table, .vdi-mini { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.vdi-table th, .vdi-table td { padding: 9px 10px; border-top: 1px solid var(--vol-line); text-align: right; white-space: nowrap; }
.vdi-table thead th { font-size: 11px; font-weight: 500; color: var(--vol-muted); background: var(--tw-gray-100); }
.vdi-table th:first-child { text-align: left; padding-left: 17px; }
.vdi-table td:last-child, .vdi-table th:last-child { padding-right: 17px; }
.vdi-table tbody th { font-weight: 600; color: var(--vol-ink); }
.vdi-table tbody th a { color: var(--tw-primary); text-decoration: none; }
.vdi-table tbody th a:hover { text-decoration: underline; text-underline-offset: 3px; }
.vdi-table small, .vdi-mini small { font-size: 10px; color: var(--vol-muted); }
.vdi-table tr.is-selected { background: var(--tw-primary-light); }
.vdi-table tr.is-night td, .vdi-table tr.is-night th { color: var(--vol-muted); }
.vdi-table tr.is-mark th { color: var(--tw-primary); }
.vdi-table tfoot th, .vdi-table tfoot td { background: var(--tw-gray-100); font-weight: 600; }
.vdi-mini caption { caption-side: top; text-align: left; padding: 0 0 6px; font-size: 12px; font-weight: 600; color: var(--vol-ink); }
.vdi-mini th, .vdi-mini td { padding: 6px 8px; border-top: 1px solid var(--vol-line); text-align: right; white-space: nowrap; }
.vdi-mini thead th { font-size: 11px; font-weight: 500; color: var(--vol-muted); }
.vdi-mini th:first-child { text-align: left; padding-left: 0; }
.vdi-mini td:last-child { padding-right: 0; }

.vol-deep-itm .vol-method code { overflow-wrap: anywhere; }

@media (max-width: 640px) {
  .vdi-chart { height: 300px; margin: 6px 2px 0 4px; }
  .vdi-chart--over { height: 120px; }
  .vdi-controls { padding: 12px; gap: 10px; }
  .vdi-controls label { flex: 1 1 calc(50% - 10px); }
  .vdi-controls select { width: 100%; }
  .vdi-steps > div { grid-template-columns: 1fr; gap: 2px; }
  .vdi-result b { font-size: 15px; }
  .vdi-card { padding: 14px; }
  .vdi-mini th, .vdi-mini td { padding: 6px 5px; }
  .vdi-mini td small { display: block; }
}
