/* Options pricer page ("Arena" look). Loaded after site.css, so these rules win on
   equal specificity. Palette comes from the site tokens: green = profit / long,
   red = loss / short, amber = spot, breakeven and anything pinned. No blue. */

.pz {
  --pz-r: 16px;
  --pz-gap: 16px;
  --ctl-h: 44px;
  --amber-bg: rgba(255, 197, 61, .12);
  --amber-line: rgba(255, 197, 61, .5);
  --up-bg: rgba(22, 214, 126, .13);
  --down-bg: rgba(255, 77, 94, .13);
  padding-top: 8px;
  padding-bottom: 56px;
  position: relative;
}
@media (hover: hover) and (pointer: fine) { .pz { --ctl-h: 40px; } }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* soft colour wash behind the header, like the home page hero */
.pz {
  background:
    radial-gradient(ellipse 360px 230px at 400px 150px, rgba(22, 214, 126, .13), transparent),
    radial-gradient(ellipse 300px 190px at 72% 190px, rgba(255, 197, 61, .06), transparent);
  background-repeat: no-repeat;
}

/* ---------- page header ---------- */
.pz-hero { padding: 28px 0 22px; max-width: 900px; }
.pz-hero h1 {
  font-family: var(--font-display); font-weight: 800; letter-spacing: -.03em;
  font-size: clamp(30px, 5vw, 48px); line-height: 1.06; margin: 10px 0 12px; text-wrap: balance;
}
.pz-hero h1 em { font-style: normal; color: var(--up); }
.pz-hero p { color: var(--muted); font-size: clamp(14px, 1.6vw, 16px); max-width: 640px; }

/* ---------- control bar ---------- */
.pz-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px;
  background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--pz-r);
  padding: 12px; margin-bottom: var(--pz-gap);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03);
}
.pz-form { display: flex; gap: 8px; flex: 0 1 340px; min-width: 0; }
.pz-search { position: relative; flex: 1; min-width: 0; display: block; color: var(--muted); }
.pz-search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.pz .pz-search .input {
  width: 100%; height: var(--ctl-h); padding-left: 38px; font-size: 16px; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase; background: var(--bg); border-radius: 12px;
}
.pz .pz-search .input::placeholder { text-transform: none; letter-spacing: 0; font-weight: 400; }
.pz .pz-search .input:focus { border-color: var(--up); box-shadow: 0 0 0 3px rgba(22, 214, 126, .16); }
.pz-load { height: var(--ctl-h); min-width: 76px; border-radius: 12px; font-size: 14px; box-shadow: 0 8px 24px -10px rgba(22, 214, 126, .7); }

.pz-spot {
  display: flex; align-items: baseline; gap: 10px; padding: 0 16px; height: var(--ctl-h);
  background: var(--amber-bg); border: 1px solid rgba(255, 197, 61, .3); border-radius: 12px;
}
.pz-spot-l { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--sideways); }
.pz-spot-v { font-size: 20px; font-weight: 700; color: var(--sideways); line-height: var(--ctl-h); }

.pz-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.pz-chip {
  height: 34px; padding: 0 12px; border-radius: 999px; font: 600 12px/1 var(--font-mono); letter-spacing: .03em;
  color: var(--muted); background: transparent; border: 1px solid var(--line); cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.pz-chip:hover { color: var(--text); border-color: var(--muted); }
.pz-chip.on { color: var(--up); border-color: rgba(22, 214, 126, .55); background: var(--up-bg); }

/* ---------- main grid ---------- */
.pz-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--pz-gap) 20px; align-items: start; }
.pz-left { display: grid; gap: var(--pz-gap); min-width: 0; }
.pz-right { position: sticky; top: 16px; min-width: 0; }

.pz-panel {
  border-radius: var(--pz-r); border-color: var(--line-soft); padding: 20px;
  box-shadow: 0 30px 60px -40px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .035);
}
.pz-ph { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px 16px; margin-bottom: 16px; }
.pz-h { font-family: var(--font-display); font-size: 20px; font-weight: 700; line-height: 1.2; }
.pz-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.pz-lab { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pz-link { background: none; border: 0; color: var(--up); font: 600 12px var(--font-ui); cursor: pointer; min-height: 28px; padding: 0 2px; }
.pz-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- strategy picker (button + popup from pricer-menu.js) ---------- */
.sm-btn {
  height: 48px; padding: 0 14px 0 10px; gap: 10px; border-radius: 12px; background: var(--bg);
  border-color: var(--line); min-width: 0;
}
.sm-btn:hover, .sm.open .sm-btn { border-color: var(--up); background: var(--bg); }
.sm-btn-name { font-size: 14px; }
.sm-btn-sub { font-size: 11px; padding: 2px 7px; border-radius: 999px; background: var(--panel-2); }
.sm-caret { font-size: 0; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translate(-2px, -2px); margin: 0 4px 0 2px; flex: none; }
.sm-pop { border-radius: 16px; box-shadow: 0 24px 60px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .03); top: calc(100% + 8px); }
.sm-search { padding: 13px 16px; font-size: 14px; background: transparent; }
.sm-list { padding: 6px; max-height: 360px; }
.sm-row { padding: 6px 10px; border-radius: 10px; min-height: 48px; gap: 8px; grid-template-columns: 58px minmax(0, 1fr) 58px 52px 60px; }
.sm-row.active { background: var(--panel-2); box-shadow: inset 2px 0 0 var(--up); }
.sm-name { font-size: 14px; font-weight: 600; }
.sm-chip { padding: 6px 6px; border-radius: 8px; min-height: 32px; }
.sm-gly-line { stroke-width: 2; }
.sm-detail { padding: 12px 16px; }
@media (max-width: 520px), (pointer: coarse) {
  .sm-row { min-height: 52px; }
  .sm-chip { min-height: 40px; }
}
@media (max-width: 520px) {
  .sm-row { grid-template-columns: 52px minmax(0, 1fr) 58px 52px; }
}

/* quick strategy cards: horizontal scroller, each card draws its own payoff */
.pz-sq {
  display: flex; gap: 8px; overflow-x: auto; margin: 0 -4px 14px; padding: 4px 4px 8px;
  scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.pz-sc {
  flex: 0 0 auto; width: 104px; min-height: 76px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 6px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line-soft);
  color: var(--muted); font: 600 12px/1.2 var(--font-ui); cursor: pointer; scroll-snap-align: start;
  transition: border-color .15s, color .15s, background .15s, transform .12s;
}
.pz-sc:hover { border-color: var(--muted); color: var(--text); transform: translateY(-1px); }
.pz-sc .sm-gly-line { stroke: var(--muted); }
.pz-sc.on { border-color: rgba(22, 214, 126, .6); background: var(--up-bg); color: var(--text); box-shadow: 0 0 0 3px rgba(22, 214, 126, .1); }
.pz-sc.on .sm-gly-line { stroke: var(--up); }
.pz-sc svg { overflow: visible; }

/* ---------- leg rows ---------- */
.pricer-legs { container-type: inline-size; padding: 20px; margin-bottom: 0; }
.pz-legs-head { display: none; }
#legRows { display: grid; gap: 10px; }
.leg-row {
  display: grid; gap: 10px 10px; margin: 0; padding: 14px; align-items: end;
  background: var(--bg); border: 1px solid var(--line-soft); border-left: 3px solid var(--line);
  border-radius: 14px; transition: border-color .2s, background .2s;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: "tag remove" "side type" "strike expiry" "qty fill";
}
.leg-row.long { border-left-color: var(--up); }
.leg-row.short { border-left-color: var(--down); }
.pz .leg-row > .lg-tag { grid-area: tag; align-self: center; display: flex; align-items: center; gap: 8px; font: 700 12px var(--font-mono); letter-spacing: .04em; color: var(--text); min-width: 0; }
.lg-tag small { font: 600 11px var(--font-ui); color: var(--muted); letter-spacing: 0; text-transform: none; }
.lg-tag .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); flex: none; }
.leg-row.long .lg-tag .dot { background: var(--up); box-shadow: 0 0 8px rgba(22, 214, 126, .7); }
.leg-row.short .lg-tag .dot { background: var(--down); box-shadow: 0 0 8px rgba(255, 77, 94, .7); }
.pz .leg-row > .lg-side { grid-area: side; }
.pz .leg-row > .lg-type { grid-area: type; }
.pz .leg-row > .lg-strike { grid-area: strike; }
.pz .leg-row > .lg-expiry { grid-area: expiry; }
.pz .leg-row > .lg-qty { grid-area: qty; }
.pz .leg-row > .lg-fillw { grid-area: fill; }
.pz .leg-row > .leg-remove { grid-area: remove; justify-self: end; }
.lg-f { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.lg-fl { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* segmented toggles */
.seg2 { display: flex; height: var(--ctl-h); padding: 3px; gap: 3px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); min-width: 0; }
.seg2 button {
  flex: 1; min-width: 0; border: 0; border-radius: 9px; background: transparent; color: var(--muted);
  font: 600 13px var(--font-ui); cursor: pointer; padding: 0 6px; transition: background .15s, color .15s, box-shadow .15s;
}
.seg2 button:hover { color: var(--text); }
.seg2 button[aria-pressed="true"] { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.seg2.side button[data-v="1"][aria-pressed="true"] { background: var(--up-bg); color: var(--up); box-shadow: inset 0 0 0 1px rgba(22, 214, 126, .55); }
.seg2.side button[data-v="-1"][aria-pressed="true"] { background: var(--down-bg); color: var(--down); box-shadow: inset 0 0 0 1px rgba(255, 77, 94, .55); }
.seg2 button:focus-visible { outline: 2px solid var(--text); outline-offset: 1px; }

/* selects and inputs */
.pz .input, .pz select.input {
  height: var(--ctl-h); border-radius: 12px; background-color: var(--panel); border-color: var(--line);
  font-size: 14px; padding: 0 12px; width: 100%; transition: border-color .15s, box-shadow .15s;
}
.pz .input:hover { border-color: #33405A; }
.pz .input:focus { border-color: var(--up); box-shadow: 0 0 0 3px rgba(22, 214, 126, .14); }
.pz select.input {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23A9B4C4' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.pz select.input:disabled { opacity: .4; cursor: default; }
.pz select.input option, .pz select.input optgroup { background: var(--panel); color: var(--text); }
.leg-row.is-stock .lg-strike, .leg-row.is-stock .lg-expiry { opacity: .5; }

/* qty stepper */
.stp { display: flex; height: var(--ctl-h); border-radius: 12px; background: var(--panel); border: 1px solid var(--line); overflow: hidden; }
.stp:focus-within { border-color: var(--up); box-shadow: 0 0 0 3px rgba(22, 214, 126, .14); }
.stp button { flex: none; width: 40px; border: 0; background: transparent; color: var(--muted); font: 500 20px/1 var(--font-ui); cursor: pointer; }
.stp button:hover:not(:disabled) { background: var(--panel-2); color: var(--text); }
.stp button:disabled { opacity: .3; cursor: default; }
.pz .stp .input { border: 0; box-shadow: none; text-align: center; padding: 0; border-radius: 0; background: transparent; min-width: 0; -moz-appearance: textfield; font-weight: 600; }
.stp .input::-webkit-outer-spin-button, .stp .input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* fill price */
.leg-fill { display: flex; align-items: center; gap: 4px; min-width: 0; height: var(--ctl-h); }
.leg-sign { font-size: 14px; font-weight: 700; width: 12px; flex: none; text-align: center; }
.pz .leg-row .leg-entry { flex: 1; min-width: 0; text-align: right; padding: 0 10px; font-weight: 600; font-size: 14px; }
.leg-revert {
  background: none; border: 0; color: var(--muted); flex: none; cursor: pointer; font-size: 16px; line-height: 1;
  width: 28px; height: 28px; border-radius: 8px;
}
.leg-revert:hover { color: var(--text); background: var(--panel-2); }
.leg-fill.edited .leg-entry { border-color: var(--amber-line); color: var(--sideways); }
.leg-fill.edited .leg-revert { color: var(--sideways); }
.leg-remove {
  width: var(--ctl-h); height: var(--ctl-h); border-radius: 12px; border: 1px solid transparent; background: transparent;
  color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; transition: color .15s, background .15s, border-color .15s;
}
.leg-remove:hover:not(:disabled) { color: var(--down); background: var(--down-bg); border-color: rgba(255, 77, 94, .3); }
.leg-remove:disabled { opacity: .25; cursor: default; }

.pz-add {
  width: 100%; margin-top: 10px; height: var(--ctl-h); border-radius: 12px; border: 1px dashed var(--line); background: transparent;
  color: var(--muted); font: 600 13px var(--font-ui); cursor: pointer; transition: color .15s, border-color .15s, background .15s;
}
.pz-add span { font-size: 18px; vertical-align: -1px; margin-right: 4px; }
.pz-add:hover:not(:disabled) { color: var(--up); border-color: rgba(22, 214, 126, .55); background: var(--up-bg); }
.pz-add:disabled { opacity: .4; cursor: default; }

/* wide container: one line per leg, with a header row above */
@container (min-width: 740px) {
  .pz-legs-head, .pz .leg-row {
    grid-template-columns: 104px 132px 88px minmax(96px, 1fr) 112px minmax(108px, 130px) var(--ctl-h);
    gap: 8px;
  }
  .pz-legs-head { display: grid; padding: 0 14px 6px 17px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
  .pz .leg-row { grid-template-areas: "side type strike expiry qty fill remove"; align-items: center; padding: 10px 12px 10px 14px; }
  .pz .leg-row > .lg-tag, .pz .lg-fl { display: none; }
}

/* net / outcomes summary */
.pz-sum {
  display: grid; grid-template-columns: auto 1fr; gap: 14px 24px; align-items: center; margin-top: 18px; padding-top: 18px;
  border-top: 1px solid var(--line-soft);
}
.pz-net { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; font-family: var(--font-mono); }
.pz-net-l { font: 700 12px var(--font-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pz .pz-net #netInput { width: 96px; text-align: right; font-size: 16px; font-weight: 700; padding: 0 10px; -moz-appearance: textfield; }
.net-price.edited #netInput { border-color: var(--amber-line); color: var(--sideways); }
.pz-net-t { font-size: 16px; font-weight: 700; }
.pz-net-t.pos { color: var(--up); } .pz-net-t.neg { color: var(--down); }
.pz-ext { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pz-x { padding: 8px 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line-soft); min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pz-x-l { font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pz-x-v { font-size: 15px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.pz-x.up .pz-x-v { color: var(--up); } .pz-x.down .pz-x-v { color: var(--down); } .pz-x.amber .pz-x-v { color: var(--sideways); }
.pz-x.up { border-color: rgba(22, 214, 126, .22); } .pz-x.down { border-color: rgba(255, 77, 94, .22); } .pz-x.amber { border-color: rgba(255, 197, 61, .22); }
@container (max-width: 640px) {
  .pz-sum { grid-template-columns: 1fr; }
}
.net-hint { font-family: var(--font-ui); font-size: 12px; color: var(--down); }

/* IV slider + rate */
.pz-model { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 28px; align-items: end; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.pz-iv { min-width: 0; }
.pz-iv-h { display: flex; justify-content: space-between; align-items: center; min-height: 28px; }
.pz-range { position: relative; padding-top: 34px; --t: .25; }
.pz-bubble {
  position: absolute; top: 0; left: calc(12px + (100% - 24px) * var(--t)); transform: translateX(-50%);
  background: var(--up); color: #03140A; font-weight: 700; font-size: 13px; line-height: 1; padding: 6px 9px; border-radius: 8px;
  box-shadow: 0 6px 18px -6px rgba(22, 214, 126, .8); pointer-events: none; white-space: nowrap;
}
.pz-bubble::after { content: ""; position: absolute; left: 50%; bottom: -4px; width: 8px; height: 8px; background: var(--up); transform: translateX(-50%) rotate(45deg); border-radius: 2px; }
.pz input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 44px; margin: 0; background: transparent; cursor: pointer; display: block;
}
.pz input[type="range"]::-webkit-slider-runnable-track {
  height: 10px; border-radius: 999px;
  background: linear-gradient(90deg, var(--up) 0, #0FA862 calc(var(--t) * 100%), var(--line) calc(var(--t) * 100%), var(--line) 100%);
}
.pz input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 26px; height: 26px; margin-top: -8px; border-radius: 50%; background: #fff;
  border: 4px solid var(--up); box-shadow: 0 0 0 0 rgba(22, 214, 126, .3), 0 4px 12px rgba(0, 0, 0, .5); transition: box-shadow .15s;
}
.pz input[type="range"]:hover::-webkit-slider-thumb, .pz input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 7px rgba(22, 214, 126, .2), 0 4px 12px rgba(0, 0, 0, .5); }
.pz input[type="range"]::-moz-range-track { height: 10px; border-radius: 999px; background: var(--line); }
.pz input[type="range"]::-moz-range-progress { height: 10px; border-radius: 999px; background: var(--up); }
.pz input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 4px solid var(--up); }
.pz input[type="range"]:focus-visible { outline: none; }
.pz-rate { display: flex; flex-direction: column; gap: 6px; }
.pz-rate-in { position: relative; display: block; }
.pz-rate-in .input { width: 110px; padding-right: 28px; text-align: right; font-size: 16px; font-weight: 600; }
.pz-rate-in i { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--muted); pointer-events: none; }

/* ---------- chart panel ---------- */
.chart-panel { padding: 20px 20px 16px; }
.pz-tools { display: flex; align-items: center; gap: 10px; flex: none; }
.pin-badge {
  position: static; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px;
  background: var(--amber-bg); border: 1px solid var(--amber-line); color: var(--sideways); font: 600 12px var(--font-mono); cursor: pointer;
  animation: pz-pop .2s ease;
}
.pin-badge:hover { background: rgba(255, 197, 61, .22); }
@keyframes pz-pop { from { transform: scale(.92); opacity: 0; } }
.y-zoom { position: static; display: flex; flex-direction: row; gap: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--bg); }
.y-zoom button {
  width: 40px; height: var(--ctl-h); border: 0; border-radius: 0; background: transparent; color: var(--muted);
  font: 500 18px var(--font-mono); cursor: pointer; border-right: 1px solid var(--line);
}
.y-zoom button:last-child { border-right: 0; width: 48px; font: 600 12px var(--font-ui); }
.y-zoom button:hover { background: var(--panel-2); color: var(--text); border-color: var(--line); }
.pz-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; margin: -4px 0 12px; font-size: 12px; color: var(--muted); }
.pz-legend li { display: flex; align-items: center; gap: 7px; }
.pz-legend .k { width: 16px; height: 0; border-top: 2px solid; display: inline-block; }
.pz-legend .k.spot { border-color: var(--sideways); }
.pz-legend .k.long { border-color: var(--up); border-top-style: dashed; }
.pz-legend .k.short { border-color: var(--down); border-top-style: dashed; }
.pz-legend .k.zone-up, .pz-legend .k.zone-dn { height: 10px; border: 0; border-radius: 3px; width: 14px; }
.pz-legend .k.zone-up { background: rgba(22, 214, 126, .35); }
.pz-legend .k.zone-dn { background: rgba(255, 77, 94, .35); }

.chart-panel .chart-wrap { border-radius: 12px; background: #0A0E14; border: 1px solid var(--line-soft); overflow: hidden; }
.chart-panel #priceChart { height: clamp(400px, 56vh, 560px); border-radius: 0; }
.chart-skel { position: absolute; inset: 16px; z-index: 3; pointer-events: none; border-radius: 10px; }
.chart-skel.gone { display: none; }
.wheel-hint { text-align: center; }
.chart-panel .loading-overlay { border-radius: var(--pz-r); }

/* payoff at expiry */
.payoff { margin-top: 18px; border-top: 1px solid var(--line-soft); padding-top: 16px; }
.payoff-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.payoff-head strong { color: var(--text); font: 700 16px var(--font-display); letter-spacing: -.01em; }
.payoff-read { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); min-height: 1.5em; margin-top: 6px; }
.payoff-svg { display: block; width: 100%; height: 240px; touch-action: pan-y; user-select: none; background: #0A0E14; border: 1px solid var(--line-soft); border-radius: 12px; }
.payoff-svg text { font-family: var(--font-mono); font-size: 10px; fill: var(--muted); }
.payoff-svg .pf-pos { fill: rgba(22, 214, 126, .24); }
.payoff-svg .pf-neg { fill: rgba(255, 77, 94, .24); }
.payoff-svg .pf-line { fill: none; stroke: var(--text); stroke-width: 2; stroke-linejoin: round; }
.payoff-svg .pf-zero { stroke: #3A465A; stroke-width: 1; }
.payoff-svg .pf-grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 5; opacity: .8; }
.payoff-svg .pf-spot { stroke: var(--sideways); stroke-width: 1.3; stroke-dasharray: 5 4; opacity: .9; }
.payoff-svg .pf-be { fill: var(--sideways); stroke: var(--panel); stroke-width: 2.5; filter: drop-shadow(0 0 4px rgba(255, 197, 61, .7)); }
.payoff-svg .pf-cur { stroke: var(--text); stroke-width: 1; opacity: .55; }
.payoff-svg .pf-dot { stroke: var(--panel); stroke-width: 2.5; }
.payoff-svg .pf-spot-t { fill: #1A1405; font-weight: 700; }
.payoff-svg .pf-spot-b { fill: var(--sideways); }
.payoff-svg .pf-pos-t { fill: var(--up); font-weight: 700; letter-spacing: .08em; }
.payoff-svg .pf-neg-t { fill: var(--down); font-weight: 700; letter-spacing: .08em; }
.payoff-svg .pf-ext-t { fill: var(--text); }

/* ---------- position readout ---------- */
.pz-right .pz-panel { padding: 20px; }
.pz-ro-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pz-at { font-size: 12px; color: var(--muted); }
.pz-at .mono { color: var(--text); }
.pz-at.pinned, .pz-at.pinned .mono, .pz-at.pinned #cursorLbl { color: var(--sideways); }
.pz-pl { font-size: clamp(38px, 4vw, 48px); font-weight: 700; letter-spacing: -.03em; line-height: 1.1; margin: 6px 0 14px; transition: color .2s, text-shadow .3s; }
.pz-pl.pos { color: var(--up); text-shadow: 0 0 36px rgba(22, 214, 126, .35); }
.pz-pl.neg { color: var(--down); text-shadow: 0 0 36px rgba(255, 77, 94, .3); }
.pz-ro-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.pz-ro-meta > div { background: var(--bg); border: 1px solid var(--line-soft); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pz-val { font-size: 16px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.pz-val.amber { color: var(--sideways); }
.pz-tbl-wrap { overflow-x: auto; }
.pz-tbl { font-size: 13px; }
.pz-tbl th { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; text-align: right; padding: 6px 4px; }
.pz-tbl th:first-child { text-align: left; }
.pz-tbl td { font-family: var(--font-mono); text-align: right; padding: 10px 4px; border-top: 1px solid var(--line-soft); }
.pz-tbl td:first-child { text-align: left; }
.lt-name { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; white-space: nowrap; }
.lt-name i { width: 3px; height: 16px; border-radius: 2px; background: var(--up); }
.lt-name.s i { background: var(--down); }
.pz-gh { font: 700 14px var(--font-display); margin: 20px 0 10px; letter-spacing: 0; }
.pz-gh span { font: 400 12px var(--font-ui); color: var(--muted); margin-left: 6px; }
.greeks-grid { grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; }
.greek { text-align: left; padding: 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line-soft); cursor: help; transition: border-color .15s; }
.greek:hover, .greek:focus-visible { border-color: var(--muted); }
.greek .l { font-size: 10.5px; letter-spacing: .08em; font-weight: 600; }
.greek .n { font-size: 20px; font-weight: 700; margin: 2px 0; }
.greek .u { font-size: 11px; color: var(--muted); }

/* ---------- state boxes ---------- */
.skeleton, .pz-skel {
  background: linear-gradient(90deg, var(--line) 25%, #1B2330 37%, var(--line) 63%); background-size: 400% 100%;
  animation: pz-shine 1.4s ease infinite;
}
@keyframes pz-shine { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.pz-state {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; border: 1px solid var(--line); background: var(--panel);
  border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; font-size: 13px; color: var(--muted);
}
.pz-state[hidden] { display: none; }
.pz-state.bad { border-color: rgba(255, 77, 94, .4); color: #FCA5A5; background: rgba(255, 77, 94, .06); }
.pz-state.delayed { border-color: rgba(255, 197, 61, .4); color: var(--sideways); background: rgba(255, 197, 61, .05); }
.pz-state strong { color: var(--text); font-weight: 600; }
.pz-state .pz-msg { flex: 1 1 220px; min-width: 0; }
.pz-state button { font: inherit; font-size: 13px; min-height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--text); cursor: pointer; }
.pz-state button:hover { border-color: var(--muted); }
.pz .err { border-radius: 12px; margin-bottom: 16px; }

/* ---------- how to read ---------- */
.howto { margin: 20px 0 0; padding: 0; border-radius: var(--pz-r); font-size: 14px; color: var(--muted); }
.howto > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; list-style: none;
  padding: 0 20px; min-height: 56px; color: var(--text); font: 700 16px var(--font-display); border-radius: var(--pz-r);
}
.howto > summary::-webkit-details-marker { display: none; }
.howto > summary::before { content: "i"; display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 10px; border-radius: 50%; border: 1.5px solid var(--muted); color: var(--muted); font: italic 700 13px Georgia, serif; flex: none; }
.howto > summary { justify-content: flex-start; }
.howto > summary::after { content: ""; margin-left: auto; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .2s; }
.howto[open] > summary::after { transform: rotate(-135deg); }
.howto-body { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; padding: 4px 20px 22px; }
.howto-body h3 { font: 700 14px var(--font-display); color: var(--text); margin-bottom: 6px; letter-spacing: 0; }
.howto-body p { line-height: 1.6; }

/* ---------- responsive ---------- */
@media (max-width: 1060px) {
  .pz-grid { grid-template-columns: minmax(0, 1fr); }
  .pz-right { position: static; }
  .pz-right .pz-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 28px; }
  .pz-right .pz-panel > * { grid-column: 1 / -1; }
  .howto-body { grid-template-columns: 1fr; gap: 16px; }
}
@media (max-width: 900px) {
  .pz-quick { margin-left: 0; width: 100%; }
  .chart-panel #priceChart { height: clamp(380px, 52vh, 520px); min-height: 0; }
}
@media (max-width: 560px) {
  .pz { padding-top: 0; padding-bottom: 40px; }
  .pz-hero { padding: 16px 0 16px; }
  .pz-bar { padding: 12px; }
  .pz-form { flex: 1 1 100%; }
  .pz-spot { flex: 1 1 100%; justify-content: space-between; }
  .pz-quick { flex-wrap: nowrap; overflow-x: auto; margin: 0 -12px; padding: 0 12px 2px; width: auto; scrollbar-width: none; }
  .pz-quick::-webkit-scrollbar { display: none; }
  .pz-chip { flex: none; height: 44px; padding: 0 16px; }
  .pz-panel, .pricer-legs, .chart-panel { padding: 16px; }
  .pz-ph { flex-direction: column; align-items: stretch; margin-bottom: 14px; }
  .pz-ph > div#stratPick, #stratPick { width: 100%; }
  .sm-btn { width: 100%; }
  .sm-btn-sub { display: inline; }
  .sm-caret { margin-left: auto; }
  .sm-btn-name { flex: 0 1 auto; }
  .pz-chart-h { flex-direction: column; }
  .pz-tools { justify-content: space-between; }
  .y-zoom { flex: 1; }
  .y-zoom button { flex: 1; width: auto; height: 44px; }
  .y-zoom button:last-child { width: auto; flex: 1.3; }
  .pin-badge { height: 44px; }
  .pz-sq { margin: 0 -4px 12px; }
  .pz-sc { width: 96px; }
  .pz-ext { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
  .pz-x { padding: 8px 8px; }
  .pz-x-v { font-size: 13px; }
  .pz-model { grid-template-columns: 1fr; }
  .pz-rate { flex-direction: row; align-items: center; justify-content: space-between; }
  .pz-right .pz-panel { display: block; }
  .payoff-svg { height: 220px; }
  .howto-body { padding: 4px 16px 18px; }
  .howto > summary { padding: 0 16px; }
  .leg-revert { width: 36px; height: 36px; }
  .pz .stp button { width: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton, .pz-skel, .pin-badge { animation: none; }
  .pz *, .pz *::before, .pz *::after { transition: none !important; }
}

/* phones and touch: 16px fields (iOS zooms the page on focus below that) and 44px tap targets */
@media (max-width: 560px), (pointer: coarse) {
  .pz .input, .pz select.input, .pz .leg-row .leg-entry, .sm-search { font-size: 16px; }
  .seg2 { height: 50px; padding: 2px; }
  .stp { height: 46px; }
  .stp button { min-height: 44px; }
}

/* ---------- payoff zoom ---------- */
.payoff-head { align-items: center; flex-wrap: wrap; }
.pf-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.pf-mode { font: 600 11px var(--font-mono); letter-spacing: .04em; color: var(--muted); padding: 4px 8px; border-radius: 999px; border: 1px solid var(--line-soft); white-space: nowrap; }
.pf-mode.own { color: var(--sideways); border-color: rgba(255, 197, 61, .4); background: var(--amber-bg); }
.pf-wrap { position: relative; }
.pf-keys { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.pf-keys .kmod, .hx .kmod { font: 600 11px var(--font-mono); border: 1px solid var(--line); border-radius: 5px; padding: 0 4px; color: var(--text); }
.payoff-svg { height: 280px; cursor: grab; }
.payoff-svg:active { cursor: grabbing; }
.payoff-svg .pf-k { stroke-width: 1; stroke-dasharray: 6 4; opacity: .55; stroke: var(--sideways); }
.payoff-svg .pf-k.l { stroke: var(--up); }
.payoff-svg .pf-k.s { stroke: var(--down); }
.payoff-svg .pf-k-t { font-weight: 700; fill: var(--sideways); }
.payoff-svg .pf-k-t.l { fill: var(--up); }
.payoff-svg .pf-k-t.s { fill: var(--down); }

/* ---------- futures + 0DTE hedge ---------- */
.hx { margin-top: var(--pz-gap, 20px); padding: 24px; }
.hx-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px 28px; margin-bottom: 18px; flex-wrap: wrap; }
.hx-head > div:first-child { max-width: 620px; }
.hx-title { font-size: 24px; margin-top: 8px; }
.hx-quote-w { display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; }
.hx-quote { display: grid; grid-template-columns: repeat(4, auto); border: 1px solid var(--line); border-radius: 14px; background: var(--bg); overflow: hidden; }
.hx-quote > div { padding: 10px 14px; display: flex; flex-direction: column; gap: 3px; border-right: 1px solid var(--line-soft); }
.hx-quote > div:last-child { border-right: 0; }
.hx-quote b { font-size: 15px; color: var(--text); white-space: nowrap; }
.hx-quote > div:first-child b { color: var(--sideways); }
.hx-grid { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 24px; align-items: start; }
.hx-ctl { display: flex; flex-direction: column; gap: 14px; }
.hx-blk { padding: 16px; border: 1px solid var(--line-soft); border-radius: 14px; background: rgba(255, 255, 255, .012); display: flex; flex-direction: column; gap: 12px; }
.hx-h { display: flex; align-items: center; gap: 10px; font: 700 14px var(--font-display); color: var(--text); }
.hx-h i { font: 700 11px var(--font-mono); font-style: normal; width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); }
.hx-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.hx .seg2 { width: 100%; }
.hx .seg2 button { flex: 1; }
.hx .seg2 button small { font-size: 10.5px; color: var(--muted); font-weight: 500; margin-left: 4px; }
.hx-f { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.hx-f > span { font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; align-items: center; min-height: 18px; }
.hx-f .input { width: 100%; height: var(--ctl-h); font-size: 14px; }
.hx-f .stp .input { text-align: center; border: 0; background: transparent; min-width: 0; height: 100%; }
.hx-reset { min-height: 18px; font-size: 11px; text-transform: none; letter-spacing: 0; }
.hx-note { font-size: 12px; color: var(--muted); line-height: 1.5; }
.hx-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.hx-presets .pz-chip { height: 34px; padding: 0 12px; font: 600 12.5px var(--font-ui); }
.hx-leg { border: 1px solid var(--line-soft); border-left: 3px solid var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; background: var(--bg); }
.hx-leg.long { border-left-color: var(--up); }
.hx-leg.short { border-left-color: var(--down); }
.hx-leg-top { display: grid; grid-template-columns: 1fr auto auto 32px; gap: 6px; align-items: center; }
.hx .hx-leg-top .seg2 { width: auto; height: 34px; }
.hx-leg-top .seg2 button { padding: 0 10px; font-size: 12.5px; }
.hx-leg-n { font: 700 12px var(--font-mono); color: var(--text); text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hx-x { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line-soft); background: transparent; color: var(--muted); font-size: 18px; cursor: pointer; }
.hx-x:hover { color: var(--down); background: var(--down-bg); }
.hx-leg-bot { display: grid; grid-template-columns: 1.3fr .7fr 1fr; gap: 8px; }
.hx-leg-bot .input { height: 38px; }
.hx-leg-meta { font-size: 11.5px; color: var(--muted); }
.hx-empty { font-size: 13px; color: var(--muted); padding: 10px 12px; border: 1px dashed var(--line); border-radius: 12px; }
.hx-acts { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.hx-add { height: 36px; padding: 0 14px; border-radius: 10px; border: 1px dashed var(--line); background: transparent; color: var(--muted); font: 600 13px var(--font-ui); cursor: pointer; }
.hx-add:hover:not(:disabled) { color: var(--up); border-color: rgba(22, 214, 126, .55); }
.hx-add:disabled { opacity: .4; cursor: default; }
.hx-trange { padding-top: 0; }
.pz .hx-trange input[type="range"]::-webkit-slider-runnable-track { background: linear-gradient(90deg, var(--sideways) 0, #D9A21F calc(var(--t) * 100%), var(--line) calc(var(--t) * 100%), var(--line) 100%); }
.pz .hx-trange input[type="range"]::-webkit-slider-thumb { border-color: var(--sideways); }
.pz .hx-trange input[type="range"]::-moz-range-progress { background: var(--sideways); }
.pz .hx-trange input[type="range"]::-moz-range-thumb { border-color: var(--sideways); }
.hx-out { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.hx-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.hx-t-s { font-size: 11px; color: var(--muted); }
.hx-chart-h { display: flex; justify-content: space-between; align-items: center; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 8px; }
.hx-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--muted); }
.hx-legend li { display: flex; align-items: center; gap: 7px; }
.hx-legend .k { width: 18px; height: 0; border-top: 2px solid; }
.hx-legend .k.fut { border-color: #8392AB; border-top-style: dashed; }
.hx-legend .k.close { border-color: var(--text); border-top-width: 2.5px; }
.hx-legend .k.at { border-color: var(--sideways); }
.hx-legend .k.spot { border-color: var(--sideways); border-top-style: dotted; }
.hx-svg { display: block; width: 100%; height: 380px; touch-action: pan-y; user-select: none; background: #0A0E14; border: 1px solid var(--line-soft); border-radius: 12px; cursor: grab; }
.hx-svg:active { cursor: grabbing; }
.hx-svg text { font-family: var(--font-mono); font-size: 10.5px; fill: var(--muted); }
.hx-svg .hx-g { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 5; opacity: .8; }
.hx-svg .hx-g.z { stroke: #3A465A; stroke-dasharray: none; opacity: 1; }
.hx-svg .hx-pos { fill: rgba(22, 214, 126, .16); }
.hx-svg .hx-neg { fill: rgba(255, 77, 94, .16); }
.hx-svg .hx-l-fut { fill: none; stroke: #8392AB; stroke-width: 1.5; stroke-dasharray: 6 5; }
.hx-svg .hx-l-close { fill: none; stroke: var(--text); stroke-width: 2.5; stroke-linejoin: round; }
.hx-svg .hx-l-at { fill: none; stroke: var(--sideways); stroke-width: 1.8; opacity: .95; }
.hx-svg .hx-k { stroke-width: 1; stroke-dasharray: 5 4; opacity: .6; }
.hx-svg .hx-k.l { stroke: var(--up); }
.hx-svg .hx-k.s { stroke: var(--down); }
.hx-svg .hx-k-t { font-weight: 700; }
.hx-svg .hx-k-t.l { fill: var(--up); }
.hx-svg .hx-k-t.s { fill: var(--down); }
.hx-svg .hx-entry { stroke: #8392AB; stroke-width: 1; opacity: .7; }
.hx-svg .hx-spot { stroke: var(--sideways); stroke-width: 1.3; stroke-dasharray: 2 3; }
.hx-svg .hx-spot-b { fill: var(--sideways); }
.hx-svg .hx-spot-t { fill: #1A1405; font-weight: 700; }
.hx-svg .hx-be { fill: var(--sideways); stroke: var(--panel); stroke-width: 2.5; }
.hx-svg .hx-cur { stroke: var(--text); stroke-width: 1; opacity: .5; }
.hx-svg .hx-dot { stroke: var(--panel); stroke-width: 2.5; }
.hx-svg .hx-dot.f { fill: #8392AB; }
.hx-tbl { width: 100%; }
.hx-tbl td.pos { color: var(--up); }
.hx-tbl td.neg { color: var(--down); }
.hx-tbl td.better { font-weight: 700; }
.hx-tbl tr.flat th, .hx-tbl tr.flat td { background: rgba(255, 255, 255, .025); }
.hx-tbl tbody th { font: 600 12.5px var(--font-mono); text-transform: none; letter-spacing: 0; color: var(--text); text-align: left; border-top: 1px solid var(--line-soft); padding: 9px 4px; }
.hx-fine { margin-top: 18px; font-size: 12px; line-height: 1.6; color: var(--muted); max-width: 980px; }

@media (max-width: 1100px) {
  .hx-grid { grid-template-columns: 1fr; }
  .hx-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .hx { padding: 16px; }
  .hx-title { font-size: 20px; }
  .hx-quote-w { align-items: stretch; width: 100%; }
  .hx-quote { grid-template-columns: 1fr 1fr; }
  .hx-quote > div:nth-child(2) { border-right: 0; }
  .hx-quote > div:nth-child(-n+2) { border-bottom: 1px solid var(--line-soft); }
  .hx-tiles { grid-template-columns: 1fr 1fr; }
  .hx-tiles .pz-x:last-child { grid-column: 1 / -1; }
  .hx-svg { height: 300px; }
  .hx-leg-top { grid-template-columns: 1fr auto 32px; }
  .hx-leg-top .hx-leg-n { grid-column: 1 / -1; }
  .hx-chart-h .y-zoom { width: 100%; }
  .payoff-svg { height: 260px; }
}
/* the svgs are redrawn on every pointer move; with their children click-through, the
   target of both clicks in a double-click is the same stable <svg>, so dblclick fires */
.payoff-svg *, .hx-svg * { pointer-events: none; }
@media (max-width: 560px) {
  .payoff-head .pz-tools { width: 100%; flex-wrap: wrap; }
  .payoff-head .y-zoom { flex: 1 1 100%; }
}
@media (max-width: 560px) {
  .hx-quote { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); width: 100%; }
  .hx-quote b { white-space: normal; font-size: 14px; }
  .hx-quote > div:nth-child(3) { border-right: 1px solid var(--line-soft); }
}

/* payoff v2: price along the bottom, today curve, extremes marked */
.pf-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); margin-right: auto; }
.pf-legend li { display: flex; align-items: center; gap: 6px; }
.pf-legend li[hidden] { display: none; }
.pf-legend .k { width: 16px; height: 0; border-top: 2px solid; display: inline-block; }
.pf-legend .k.exp { border-color: var(--text); border-top-width: 2.5px; }
.pf-legend .k.t0 { border-color: var(--sideways); border-top-style: dashed; }
.pf-legend .k.be { width: 9px; height: 9px; border: 0; border-radius: 50%; background: var(--sideways); }
.payoff-svg .pf-t0 { fill: none; stroke: var(--sideways); stroke-width: 1.8; stroke-dasharray: 6 4; opacity: .95; }
.payoff-svg .pf-dot.t0 { fill: var(--sideways); }
.payoff-svg text.pf-pos-t, .payoff-svg text.pf-neg-t { letter-spacing: 0; font-weight: 600; }
.payoff-svg .pf-ext { stroke: var(--panel); stroke-width: 2; }
.payoff-svg .pf-ext.p { fill: var(--up); }
.payoff-svg .pf-ext.l { fill: var(--down); }
.payoff-svg .pf-ext-b { stroke-width: 1; }
.payoff-svg .pf-ext-b.p { fill: #0B1F17; stroke: rgba(22, 214, 126, .6); }
.payoff-svg .pf-ext-b.l { fill: #251116; stroke: rgba(255, 77, 94, .6); }
.payoff-svg text.pf-ext-t { font-weight: 700; font-size: 10.5px; }
.payoff-svg text.pf-ext-t.p { fill: var(--up); }
.payoff-svg text.pf-ext-t.l { fill: var(--down); }

/* hedge P/L table: futures + hedge = net, 0.25% rows, strike and breakeven rows */
.hx-tbl-h { display: flex; flex-direction: column; gap: 4px; }
.hx-tbl-w { max-height: 560px; overflow: auto; border: 1px solid var(--line-soft); border-radius: 12px; }
.hx-tbl thead th { position: sticky; top: 0; background: var(--panel); z-index: 1; padding: 10px 8px; }
.hx-tbl td, .hx-tbl tbody th { padding: 7px 8px; }
.hx-tbl td.muted { color: var(--muted); }
.hx-tbl td.net { font-weight: 700; }
.hx-tbl tbody th small { display: block; font: 600 10px var(--font-ui); letter-spacing: .04em; text-transform: uppercase; color: var(--sideways); margin-top: 1px; }
.hx-tbl tr.tagged th, .hx-tbl tr.tagged td { background: rgba(255, 197, 61, .05); }
@media (max-width: 560px) {
  .hx-tbl { font-size: 12px; }
  .hx-tbl td, .hx-tbl tbody th, .hx-tbl thead th { padding: 7px 5px; }
}
@media (max-width: 560px) { .hx-tbl .c-val { display: none; } }
@media (max-width: 560px) {
  .hx-tbl { font-size: 11.5px; }
  .hx-tbl td, .hx-tbl tbody th, .hx-tbl thead th { padding: 6px 3px; }
  .hx-tbl thead th { font-size: 9.5px; letter-spacing: .04em; }
}

/* hedge: expected-move and volume-profile levels (toggles, chart lines, table rows) */
.hx-levels { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hx-levels .hx-note { flex: 1 1 100%; }
.hx-tog { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--muted); font: 600 12.5px var(--font-ui); cursor: pointer; }
.hx-tog i { width: 14px; height: 0; border-top: 2px solid currentColor; }
.hx-tog[aria-pressed="true"] { color: var(--text); background: var(--panel-2); }
.hx-tog.em[aria-pressed="true"] i { border-color: #B48CFF; border-top-style: dotted; border-top-width: 3px; }
.hx-tog.poc[aria-pressed="true"] i { border-color: #5AA9FF; }
.hx-tog.vah[aria-pressed="true"] i, .hx-tog.val[aria-pressed="true"] i { border-color: #5AA9FF; border-top-style: dashed; }
.hx-tog[aria-pressed="false"] { opacity: .6; text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, .25); }
.hx-tog:focus-visible { outline: 2px solid var(--text); outline-offset: 1px; }
.hx .hx-lvsrc { width: auto; height: 34px; margin-left: auto; }
.hx .hx-lvsrc button { padding: 0 12px; font-size: 12.5px; }
.hx .hx-lvsrc button:disabled { opacity: .35; cursor: default; }
.hx-svg .hx-emband { fill: rgba(180, 140, 255, .06); }
.hx-svg .hx-lv { stroke-width: 1.4; }
.hx-svg .hx-lv.em { stroke: #B48CFF; stroke-dasharray: 2 4; }
.hx-svg .hx-lv.poc { stroke: #5AA9FF; }
.hx-svg .hx-lv.vah, .hx-svg .hx-lv.val { stroke: #5AA9FF; stroke-dasharray: 6 4; opacity: .8; }
.hx-svg .hx-lv-b { fill: #0D1626; stroke-width: 1; }
.hx-svg .hx-lv-b.em { stroke: rgba(180, 140, 255, .6); fill: #160F24; }
.hx-svg .hx-lv-b.poc, .hx-svg .hx-lv-b.vah, .hx-svg .hx-lv-b.val { stroke: rgba(90, 169, 255, .6); }
.hx-svg text.hx-lv-t { font-weight: 700; font-size: 10px; }
.hx-svg text.hx-lv-t.em { fill: #B48CFF; }
.hx-svg text.hx-lv-t.poc, .hx-svg text.hx-lv-t.vah, .hx-svg text.hx-lv-t.val { fill: #5AA9FF; }
.hx-tbl tr.lv th small { color: #5AA9FF; }
.hx-tbl tr.lv-em th small { color: #B48CFF; }
.hx-tbl tr.lv th, .hx-tbl tr.lv td { background: rgba(90, 169, 255, .05); }
.hx-tbl tr.lv-em th, .hx-tbl tr.lv-em td { background: rgba(180, 140, 255, .06); }
@media (max-width: 560px) {
  .hx .hx-lvsrc { margin-left: 0; }
}
.hx-tbl tr.lv th small { text-transform: none; letter-spacing: 0; }
.hx .hx-lvsrc button { white-space: nowrap; }

/* ---------- hedge design pass (critique 2026-11-26) ----------
   Colour roles: amber = live price and breakevens only. "Value before expiry"
   (hedged at the chosen time here, the today/pinned curve on the payoff) is pink,
   so a curve is never mistaken for the live-price line. */
.hx-svg .hx-l-at { stroke: #FF8FC7; }
.hx-legend .k.at { border-color: #FF8FC7; }
.pz .hx-trange input[type="range"]::-webkit-slider-runnable-track { background: linear-gradient(90deg, #FF8FC7 0, #E06BA8 calc(var(--t) * 100%), var(--line) calc(var(--t) * 100%), var(--line) 100%); }
.pz .hx-trange input[type="range"]::-webkit-slider-thumb { border-color: #FF8FC7; }
.pz .hx-trange input[type="range"]::-moz-range-progress { background: #FF8FC7; }
.pz .hx-trange input[type="range"]::-moz-range-thumb { border-color: #FF8FC7; }
.payoff-svg .pf-t0 { stroke: #FF8FC7; }
.payoff-svg .pf-dot.t0 { fill: #FF8FC7; }
.pf-legend .k.t0 { border-color: #FF8FC7; }

/* levels recede until the pointer is near one */
.hx-svg .hx-lv { stroke-width: 1; opacity: .42; }
.hx-svg .hx-lv.hot { stroke-width: 2; opacity: 1; }
.hx-svg .hx-lv-b { opacity: .9; }
.hx-svg .hx-lv-b.hot { opacity: 1; stroke-width: 1.5; }

/* the lead tile: max loss is the number a hedger checks first */
.hx-tiles { grid-template-columns: 1.25fr 1fr 1.2fr 1fr 1fr; }
.hx-tiles .pz-x-v { white-space: nowrap; }
.hx-tiles .pz-x-v.two { font-size: 13.5px; }
.hx-tiles .pz-x-l small { text-transform: none; letter-spacing: 0; font-weight: 500; opacity: .8; }
.hx-tiles .hx-lead { background: var(--down-bg); border-color: rgba(255, 77, 94, .45); }
.hx-tiles .hx-lead .pz-x-v { font-size: 20px; }

/* refresh lives in the quote strip, with the time of the last quote */
.hx-refresh { padding: 10px 14px; display: flex; flex-direction: column; gap: 3px; text-align: left; background: transparent; border: 0; border-left: 1px solid var(--line-soft); color: inherit; font: inherit; cursor: pointer; }
.hx-refresh b { font-size: 15px; color: var(--text); white-space: nowrap; }
.hx-refresh b span { color: var(--up); }
.hx-refresh:hover { background: var(--panel-2); }
.hx-refresh:disabled { opacity: .5; cursor: default; }
.hx-refresh:focus-visible { outline: 2px solid var(--text); outline-offset: -2px; }
.hx-quote { grid-template-columns: repeat(5, auto); }

/* one help line under the chart; it becomes the readout while hovering */
.hx-help { min-height: 1.6em; }
.hx-help.reading { font-family: var(--font-mono); font-size: 12.5px; color: var(--text); }

/* the table spans the whole section, under controls and chart */
.hx-tbl-block { margin-top: 24px; display: flex; flex-direction: column; gap: 10px; }
.hx-tbl-w { max-height: 520px; }

@media (max-width: 1100px) {
  .hx-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .hx-quote { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .hx-refresh { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line-soft); flex-direction: row; justify-content: space-between; align-items: center; min-height: 44px; }
  .hx-tiles { grid-template-columns: 1fr 1fr; }
  .hx-tiles .hx-lead { grid-column: 1 / -1; }
  .hx-tiles .pz-x:last-child { grid-column: auto; }
}

/* model sliders under the chart, side by side on wide screens */
.hx-model { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; align-items: start; }
.hx-model > .hx-h { grid-column: 1 / -1; }
@media (max-width: 760px) { .hx-model { grid-template-columns: 1fr; } }
/* the 0% row is the live price: amber edge, like the live-price line */
.hx-tbl tr.flat th { box-shadow: inset 3px 0 0 var(--sideways); }
.hx-tbl tr.flat th, .hx-tbl tr.flat td { background: rgba(255, 197, 61, .07); }

/* ---------- view tabs: Options pricer / Hedge Trade ---------- */
.pz-tabs {
  display: flex; gap: 4px; margin: 0 0 16px; padding: 4px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; width: fit-content; max-width: 100%;
}
.pz-tabs button {
  min-height: 44px; padding: 0 22px; border: 0; border-radius: 10px; cursor: pointer;
  background: transparent; color: var(--muted);
  font-family: var(--font-display); font-size: 16px; font-weight: 700;
  transition: background .15s, color .15s;
}
.pz-tabs button:hover { color: var(--text); background: var(--panel-2); }
.pz-tabs button[aria-selected="true"] {
  color: var(--text); background: rgba(22, 214, 126, .15); box-shadow: inset 0 0 0 1px rgba(22, 214, 126, .5);
}
.pz-tabs button:focus-visible { outline: 2px solid var(--text); outline-offset: 1px; }
#tabHedge .hx { margin-top: 0; }
@media (max-width: 600px) {
  .pz-tabs { width: 100%; }
  .pz-tabs button { flex: 1 1 0; padding: 0 8px; font-size: 15px; }
}
#tabHedge .hx-title { margin-top: 0; }
