/* The option board (/options/<symbol>): the underlying's strip, the expiry rail, a two-sided chain with
   bids, asks and their sizes, polled every few seconds, and the trade panel beside it. Theme tokens from
   app.css; green/red only ever mean calls/up and puts/down. */

.hlink.options-link svg { stroke-width: 1.8; }

/* ----- head: title, symbol picker */
.op-head { margin-bottom: 14px; align-items: flex-end; }
.op-pick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.op-pick .iv-search { width: 240px; }
.op-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.op-chips a { height: 28px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--text-2); font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; transition: color var(--dur), border-color var(--dur), background var(--dur); }
.op-chips a:hover { color: var(--text); border-color: var(--line-2); }
.op-chips a.on { color: var(--text); background: var(--bg-soft); border-color: var(--line-2); }

/* ----- the underlying's strip */
.op-under { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px 20px; padding: 14px 18px; margin-bottom: 12px; }
.op-under .who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.op-under .who b { display: block; font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.op-under .who small { display: block; color: var(--text-2); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.op-price { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.op-price b { font-size: 28px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.op-price .chg { font-size: 14px; }
.op-book { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); }
.op-book div { display: grid; gap: 1px; }
.op-book small { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }
.op-book b { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; font-size: 14px; }
.op-book b em { font-style: normal; color: var(--text-3); font-weight: 500; font-size: 12px; margin-left: 3px; }
.op-book b.bid { color: var(--yes-ink); }
.op-book b.ask { color: var(--no-ink); }
.op-asof { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); white-space: nowrap; }
.op-asof .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.op-asof.live .dot { background: var(--yes); animation: blink 1.4s infinite; }

/* ----- the expiry rail */
.op-exps { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 3px; border-radius: 10px; background: var(--bg-soft); margin-bottom: 12px; }
.op-exps::-webkit-scrollbar { display: none; }
.op-exps button { flex: none; display: grid; gap: 1px; justify-items: center; min-width: 64px; padding: 6px 10px; border: 0; border-radius: 8px; background: none; color: var(--text-2); font-size: 12.5px; font-weight: 600; line-height: 1.1; transition: background var(--dur), color var(--dur); }
.op-exps button small { font-size: 10.5px; font-weight: 500; color: var(--text-3); }
.op-exps button:hover { color: var(--text); }
.op-exps button.on { background: var(--panel); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 0 0 1px rgba(0, 0, 0, .04); }
.op-exps button.on small { color: var(--text-2); }
.op-exps button.monthly { position: relative; }
.op-exps button.monthly::after { content: ""; position: absolute; top: 5px; right: 6px; width: 4px; height: 4px; border-radius: 50%; background: var(--blue); }

/* ----- the board and the panel */
.op-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.op-main { min-width: 0; display: grid; gap: 10px; }
.op-main > *, .op-side > * { min-width: 0; }
.op-side { display: grid; gap: 14px; }
.op-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.op-tools .seg button { height: 26px; padding: 0 10px; font-size: 12.5px; }
.op-tools .sides { display: none; }
.op-chain { overflow: hidden; }
.op-tbl { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.op-tbl th { padding: 7px 8px; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); border-bottom: 1px solid var(--line); white-space: nowrap; text-align: right; }
.op-tbl th.c, .op-tbl td.c { text-align: center; }
.op-tbl thead tr:first-child th { padding-top: 10px; padding-bottom: 4px; border-bottom: 0; font-size: 12px; }
.op-tbl th.calls { color: var(--yes-ink); }
.op-tbl th.puts { color: var(--no-ink); }
.op-tbl td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.op-tbl tbody tr:last-child td { border-bottom: 0; }
.op-tbl td.strike { background: var(--bg-soft); font-weight: 700; text-align: center; color: var(--text); }
.op-tbl td.strike small { display: block; font-size: 9.5px; font-weight: 700; letter-spacing: .08em; color: var(--blue); }
.op-tbl tr.atm td.strike { box-shadow: inset 0 0 0 1px var(--blue); }
.op-tbl td.opc { cursor: pointer; position: relative; transition: background var(--dur); }
.op-tbl td.opc small { display: block; font-size: 10.5px; color: var(--text-3); font-weight: 500; line-height: 1.2; }
.op-tbl td.opc.itm.call { background: color-mix(in srgb, var(--yes) 8%, transparent); }
.op-tbl td.opc.itm.put { background: color-mix(in srgb, var(--no) 8%, transparent); }
.op-tbl tr:hover td.opc.call, .op-tbl tr:hover td.opc.put { background: color-mix(in srgb, var(--blue) 7%, transparent); }
.op-tbl td.opc.sel { background: var(--blue-soft) !important; }
.op-tbl tr.sel-call td.opc.call, .op-tbl tr.sel-put td.opc.put { box-shadow: inset 0 -2px 0 var(--blue); }
.op-tbl td.opc.held { font-weight: 700; }
.op-tbl td.bidc b { color: var(--yes-ink); font-weight: 600; }
.op-tbl td.askc b { color: var(--no-ink); font-weight: 600; }
.op-tbl td.faint { color: var(--text-3); }
/* a changed number flashes, green up and red down, then fades */
.op-tbl td.flash-up { animation: op-up .7s var(--ease); border-radius: 0; }
.op-tbl td.flash-down { animation: op-down .7s var(--ease); border-radius: 0; }
.flash-up { animation: op-up .7s var(--ease); border-radius: 4px; }
.flash-down { animation: op-down .7s var(--ease); border-radius: 4px; }
@keyframes op-up { from { background: color-mix(in srgb, var(--yes) 20%, transparent); } }
@keyframes op-down { from { background: color-mix(in srgb, var(--no) 20%, transparent); } }
.op-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--text-2); line-height: 1.45; }
.op-foot .btn.sm { height: 26px; padding: 0 9px; font-size: 12px; }
.op-empty { padding: 48px 20px; text-align: center; color: var(--text-2); }

/* the trade panel on this page: the contract's details and the payoff at expiry */
.op-side .tp { position: sticky; top: 128px; }
.op-contract { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
.op-contract div { padding: 7px 8px; border-radius: 8px; background: var(--bg-soft); font-size: 12px; color: var(--text-2); }
.op-contract div b { display: block; color: var(--text); font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; }
.op-contract div b.bid { color: var(--yes-ink); }
.op-contract div b.ask { color: var(--no-ink); }
.op-contract div b em { font-style: normal; color: var(--text-3); font-weight: 500; font-size: 11px; margin-left: 2px; }
.op-payoff { margin-top: 12px; }
.op-payoff svg { width: 100%; height: 118px; display: block; overflow: visible; }
.op-payoff .cap { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.op-mine .row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.op-mine .row:first-of-type { border-top: 0; }
.op-mine .row b { font-weight: 600; }
.op-mine .row small { display: block; color: var(--text-3); font-size: 12px; }
.op-mine .row .r { text-align: right; }
.op-mine h3 { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.op-mine { padding: 14px 16px; }

@media (max-width: 1100px) {
  .op-layout { grid-template-columns: minmax(0, 1fr) 320px; }
}
@media (max-width: 920px) {
  .op-layout { grid-template-columns: minmax(0, 1fr); }
  .op-side .tp { position: static; }
  .op-under { grid-template-columns: minmax(0, 1fr); }
  .op-tools .sides { display: inline-flex; }
  /* a phone shows one side of the chain at a time */
  .op-chain.show-calls .put, .op-chain.show-calls th.puts, .op-chain.show-puts .call, .op-chain.show-puts th.calls { display: none; }
  .op-contract { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  /* a phone keeps IV, last, bid and ask; volume and open interest go */
  .op-tbl .vol, .op-tbl .oi { display: none; }
  .op-tbl td { padding: 6px 5px; font-size: 12.5px; }
  .op-tbl th { padding: 6px 5px; }
}
