:root {
  --bg: #0c1117;
  --bg-2: #121820;
  --card: #151c25;
  --line: #2a3545;
  --text: #e8eef6;
  --muted: #8b98a8;
  --accent: #5b8cff;
  --accent-2: #f0c35b;
  --up: #3ddc91;
  --down: #ff6b6b;
  --radius: 16px;
  --pad: 12px;
  --bottom-bar-h: 72px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  overscroll-behavior-x: none;
}

body {
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

body[data-view="trade"] {
  overflow: hidden;
}

#app {
  max-width: 760px;
  margin: 0 auto;
  min-height: 100dvh;
}

.view {
  padding: var(--pad);
}

.view[hidden] {
  display: none !important;
}

.view-pick {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
}

.view-trade {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-height: 100dvh;
  padding-bottom: calc(var(--bottom-bar-h) + env(safe-area-inset-bottom));
  overflow: hidden;
}

.view-results {
  min-height: 100dvh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 10px;
}

.brand h1 {
  font-size: clamp(1.6rem, 6vw, 2.2rem);
  line-height: 1.15;
  margin: 8px 0 10px;
}

.eyebrow {
  color: var(--accent-2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 700;
  margin: 0;
}

.lede, .hint {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
  margin: 0;
}

.search-card, .quote-card, .trade-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
}

.search-card label, .field span, .strike-input span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  margin-bottom: 6px;
}

.section-title {
  display: block;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}

.chain-head .section-title {
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.search-row, .topbar, .quote-head, .controls, .results-bar, .chart-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
}

.search-row input, select, input[type="range"], input[type="number"] {
  width: 100%;
}

input, select, button {
  font: inherit;
  color: var(--text);
}

input, select {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  min-height: 42px;
}

.search-row button, .primary {
  background: var(--accent);
  color: #071018;
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  min-height: 42px;
  font-weight: 700;
  cursor: pointer;
}

button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chips button, .periods button, .segmented button, .text-btn {
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  min-height: 34px;
  cursor: pointer;
}

.text-btn {
  background: transparent;
  color: var(--accent);
  border: 0;
  padding: 8px;
}

.topbar, .results-bar {
  justify-content: space-between;
  flex-shrink: 0;
}

.topbar strong, .results-summary strong {
  letter-spacing: 0.04em;
}

.quote-card.compact {
  flex-shrink: 0;
  padding: 10px 12px;
}

.quote-main h2 {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.2;
}

.quote-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.price {
  font-size: 1.45rem;
  font-weight: 750;
  color: var(--accent-2);
  font-variant-numeric: tabular-nums;
}

.change {
  font-weight: 700;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.up { color: var(--up); }
.down { color: var(--down); }

.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 8px;
  color: var(--muted);
  font-size: 0.68rem;
  white-space: normal;
  text-align: right;
  line-height: 1.2;
  max-width: 8.5rem;
}

.chart-toolbar {
  justify-content: space-between;
  margin: 8px 0 4px;
}

.chart-toolbar .segmented.mini,
.chart-toolbar .periods.compact {
  flex: 1;
}

.periods.compact button {
  padding: 6px 8px;
  min-height: 30px;
  font-size: 0.72rem;
}

.chart-block {
  min-height: 108px;
}

.chart-compact {
  display: flex;
  gap: 4px;
  height: 88px;
  margin: 0;
}

.chart-yaxis {
  width: 42px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2px 4px 2px 0;
  font-size: 0.62rem;
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.chart-plot {
  position: relative;
  flex: 1;
  min-width: 0;
  touch-action: none;
}

.chart-plot svg {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-crosshair {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(232, 238, 246, 0.55);
  pointer-events: none;
  transform: translateX(-0.5px);
}

.chart-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px solid #0c1117;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.chart-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  background: rgba(16, 22, 30, 0.96);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 0.68rem;
  white-space: nowrap;
  pointer-events: none;
  z-index: 2;
}

.chart-tooltip strong {
  display: block;
  font-size: 0.72rem;
}

.chart-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
  padding: 0 8px;
}

.chart svg {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-caption {
  margin: 4px 0 0;
  min-height: 18px;
  color: var(--muted);
  font-size: 0.68rem;
}

.periods, .segmented {
  display: flex;
  gap: 6px;
}

.periods button, .segmented button {
  flex: 1;
}

.periods button.active, .segmented button.active, .chips button.active {
  background: #1d2c4a;
  border-color: var(--accent);
  color: #dce7ff;
}

.stats-inline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 8px 0 0;
}

.stats-inline div {
  background: var(--bg-2);
  border-radius: 8px;
  padding: 6px 8px;
}

.stats-inline dt {
  color: var(--muted);
  font-size: 0.62rem;
}

.stats-inline dd {
  margin: 1px 0 0;
  font-weight: 700;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.trade-card {
  margin-top: 8px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-bottom: 8px;
}

.trade-controls {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 8px;
  align-items: end;
  margin-bottom: 8px;
}

.compact-field {
  margin: 0;
}

.compact-field select {
  min-height: 40px;
  padding: 8px 10px;
  font-weight: 600;
}

.segmented.mini {
  min-width: 0;
  margin: 0;
}

.chain-head {
  margin: 0 0 6px;
}

.chain-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #10161e;
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.chain-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-2);
  -webkit-overflow-scrolling: touch;
}

.chain-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
}

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

.th-help {
  background: transparent;
  border: 0;
  color: var(--text);
  padding: 0;
  min-height: auto;
  font-size: inherit;
  font-weight: inherit;
  text-decoration: underline dotted;
  text-underline-offset: 2px;
  cursor: pointer;
}

.chain-table th:first-child,
.chain-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  text-align: left;
  background: var(--bg-2);
  font-weight: 700;
}

.chain-table th:first-child {
  z-index: 3;
  background: #10161e;
}

.chain-table tbody tr {
  cursor: pointer;
}

.chain-table tbody tr:hover td {
  background: #1a2430;
}

.chain-table tbody tr.atm td:first-child {
  box-shadow: inset 3px 0 0 var(--accent-2);
}

.chain-table tbody tr.selected td {
  background: #1d2c4a;
}

.chain-table tbody tr.selected td:first-child {
  background: #1d2c4a;
  box-shadow: inset 3px 0 0 var(--accent);
}

.bar-cell {
  min-width: 72px;
}

.bar-metric {
  display: grid;
  gap: 3px;
  justify-items: end;
}

.bar-metric span {
  font-weight: 700;
  font-size: 0.72rem;
}

.bar-track {
  width: 100%;
  min-width: 52px;
  height: 6px;
  border-radius: 999px;
  background: #0c121a;
  overflow: hidden;
}

.bar {
  height: 100%;
  border-radius: inherit;
}

.bar.vol {
  background: linear-gradient(90deg, #3d7dff, #7ad1ff);
}

.bar.oi {
  background: linear-gradient(90deg, #c9842a, #f0c35b);
}

.chain-empty {
  padding: 18px 12px;
  text-align: center;
  color: var(--muted);
}

.bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: rgba(12, 17, 23, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.bottom-bar[hidden] {
  display: none !important;
}

.bottom-bar-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.bottom-bar-copy strong {
  font-size: 0.92rem;
}

.bottom-bar-copy span {
  color: var(--muted);
  font-size: 0.72rem;
}

.bottom-bar .primary {
  width: auto;
  min-width: 120px;
  margin: 0;
}

.help-modal {
  width: min(92vw, 360px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: var(--text);
  padding: 16px;
}

.help-modal::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.help-modal h3 {
  margin: 0 0 8px;
}

.help-modal p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.92rem;
}

.banner {
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 0.82rem;
}

.banner.error, .error {
  background: rgba(255, 107, 107, 0.12);
  color: #ffb4b4;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--bottom-bar-h) + 12px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: #203049;
  color: var(--text);
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 0.86rem;
  z-index: 30;
}

.results-summary {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 2px;
  min-width: 0;
  order: 1;
}

#back-trade {
  order: 2;
  flex-shrink: 0;
}

.results-summary strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.results-summary span {
  color: var(--muted);
  font-size: 0.78rem;
}

.controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
}

.strike-window {
  display: grid;
  grid-template-columns: minmax(76px, 0.7fr) minmax(110px, 1.6fr) minmax(76px, 0.7fr);
  gap: 8px;
  align-items: end;
}

.strike-input {
  min-width: 0;
}

.strike-input span,
.strike-slider-label {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.strike-input input {
  min-height: 40px;
  width: 100%;
  padding: 7px 8px;
  border-color: #3b4b63;
  font-size: 0.84rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.strike-slider {
  position: relative;
  height: 40px;
  min-width: 0;
  padding-top: 17px;
}

.strike-slider::before,
.strike-slider::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  height: 6px;
  top: 29px;
  border-radius: 999px;
}

.strike-slider::before {
  background: #29374b;
}

.strike-slider::after {
  left: calc(8px + var(--min-position, 0%));
  right: calc(8px + (100% - var(--max-position, 100%)));
  background: linear-gradient(90deg, #4774d8, var(--accent));
  box-shadow: 0 0 8px rgba(91, 140, 255, 0.35);
}

.strike-slider input[type="range"] {
  position: absolute;
  left: 8px;
  right: 8px;
  width: calc(100% - 16px);
  min-height: 22px;
  padding: 0;
  margin: 0;
  background: transparent;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
  z-index: 1;
}

.strike-slider input[type="range"]::-webkit-slider-thumb {
  pointer-events: auto;
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #dce7ff;
  border: 3px solid var(--accent);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.45);
}

.strike-slider input[type="range"]::-moz-range-thumb {
  pointer-events: auto;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #dce7ff;
  border: 3px solid var(--accent);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.45);
}

.strike-slider input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: transparent;
}

.strike-slider input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: transparent;
}

.strike-slider #strike-min-range {
  top: 17px;
}

.strike-slider #strike-max-range {
  top: 17px;
}

.heatmap {
  flex: 1;
  min-height: 52dvh;
  display: grid;
  gap: 1px;
  background: #223044;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
}

.cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-2);
  padding: 2px 2px;
  min-width: 0;
  text-align: center;
  font-size: clamp(8px, 2.2vw, 11px);
  line-height: 1.1;
}

.cell.head {
  background: #10161e;
  color: var(--muted);
  font-size: clamp(7px, 2vw, 10px);
  font-weight: 700;
}

.cell.rowhead {
  align-items: flex-end;
  padding-right: 4px;
  background: #10161e;
  font-weight: 700;
}

.cell.rowhead small {
  color: var(--muted);
  font-weight: 500;
}

.cell.spot {
  box-shadow: inset 2px 0 0 var(--accent-2);
}

.cell.strike {
  outline: 1px solid rgba(91, 140, 255, 0.7);
  outline-offset: -1px;
}

.hint {
  font-size: 0.72rem;
}

@media (min-width: 720px) {
  .view-pick, .view {
    padding: 24px;
  }

  .view-trade {
    padding-bottom: calc(var(--bottom-bar-h) + 16px);
  }

  .chart-block {
    min-height: 140px;
  }

  .chart-compact {
    height: 120px;
  }

  .price {
    font-size: 2rem;
  }

  .bottom-bar {
    max-width: 760px;
    margin: 0 auto;
    left: 50%;
    transform: translateX(-50%);
  }

  .strike-window {
    flex: 1;
  }

  .cell, .cell.head {
    font-size: 11px;
  }
}

@media (max-width: 420px) {
  .segmented.mini {
    width: 100%;
  }
}

.view-analyzer {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-bottom: calc(28px + env(safe-area-inset-bottom));
}

.switch-form {
  flex: 1;
  min-width: 0;
}

.switch-form input {
  width: 100%;
  min-height: 36px;
  padding: 6px 10px;
  text-transform: uppercase;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.quote-hero {
  padding: 4px 2px 2px;
}

.quote-symbol {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 750;
  letter-spacing: 0.06em;
}

.company {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 0.78rem;
}

.quote-hero .price {
  font-size: clamp(2rem, 8vw, 2.8rem);
  line-height: 1;
}

.quote-hero .change {
  font-size: 1rem;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-top: 12px;
}

.panel h2,
.result-card h2,
.section-head h2 {
  margin: 0;
  font-size: 1rem;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.field-label,
.target-label {
  display: block;
  margin: 10px 0 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}

.target-label b {
  color: var(--text);
}

.scenario-top {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 8px;
  align-items: end;
}

.strike-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.strike-chip {
  flex: 0 0 auto;
  min-width: 72px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
}

.strike-chip strong,
.strike-chip small {
  display: block;
}

.strike-chip strong {
  font-size: 0.95rem;
}

.strike-chip small {
  color: var(--muted);
  font-size: 0.68rem;
  margin-top: 2px;
}

.strike-chip.selected {
  border-color: var(--accent);
  background: #1d2c4a;
}

.strike-chip.atm strong::after {
  content: " ATM";
  color: var(--accent-2);
  font-size: 0.62rem;
  letter-spacing: 0.04em;
}

.target-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.target-row input[type="number"] {
  max-width: 148px;
  font-size: 1.15rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.target-move {
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  font-size: 0.92rem;
}

.target-range {
  width: 100%;
  margin-top: 8px;
  accent-color: var(--accent);
}

.move-chips {
  margin-top: 8px;
}

.result-card {
  margin-top: 12px;
  padding: 16px 14px 12px;
  border-radius: 18px;
  border: 1px solid #35507a;
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(91, 140, 255, 0.18), transparent 52%),
    var(--card);
}

.hero-kicker {
  margin: 0;
  font-size: clamp(1.05rem, 3.6vw, 1.28rem);
  line-height: 1.3;
  font-weight: 700;
}

.hero-kicker b {
  color: var(--accent-2);
}

.hero-contract {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.hero-pnl {
  margin: 8px 0 0;
  font-size: clamp(2.4rem, 11vw, 3.5rem);
  font-weight: 760;
  letter-spacing: -0.04em;
  line-height: 0.95;
  font-variant-numeric: tabular-nums;
}

.hero-unit,
.hero-detail {
  margin: 6px 0 0;
}

.hero-unit {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-detail {
  font-size: 0.95rem;
  font-weight: 700;
}

.hero-facts {
  display: flex;
  gap: 6px;
  margin: 12px 0 0;
  overflow-x: auto;
}

.hero-facts div {
  flex: 1 0 84px;
  background: rgba(8, 12, 18, 0.38);
  border-radius: 10px;
  padding: 8px;
}

.hero-facts dt {
  color: var(--muted);
  font-size: 0.66rem;
}

.hero-facts dd {
  margin: 2px 0 0;
  font-weight: 750;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}

.payoff-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 14px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 750;
}

.legend-item i {
  width: 14px;
  height: 3px;
  border-radius: 99px;
  display: inline-block;
}

.legend-item em {
  font-style: normal;
  color: var(--muted);
  font-weight: 700;
}

.payoff-chart {
  display: flex;
  gap: 4px;
  height: 230px;
  margin-top: 6px;
}

.payoff-chart .chart-plot {
  touch-action: none;
}

.payoff-yaxis {
  position: relative;
  display: block;
  height: 100%;
}

.payoff-yaxis span {
  position: absolute;
  right: 2px;
  transform: translateY(-50%);
  white-space: nowrap;
}

.payoff-tip {
  position: absolute;
  top: 8px;
  transform: translateX(-50%);
  background: rgba(16, 22, 30, 0.96);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
}

.insight {
  margin: 0 0 10px;
  background: #182232;
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 10px 12px;
  line-height: 1.45;
  font-size: 0.92rem;
}

.compare-editors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.leg-editor {
  border: 1px solid var(--line);
  border-top: 3px solid var(--leg, var(--accent));
  border-radius: 12px;
  padding: 8px;
  display: grid;
  gap: 6px;
  background: var(--bg-2);
}

.leg-editor-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.leg-editor-top strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
}

.leg-editor label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.add-leg {
  min-height: 72px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: transparent;
  color: var(--accent);
  font-weight: 750;
  cursor: pointer;
}

.table-scroll {
  overflow-x: auto;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  font-size: 0.8rem;
}

.compare-table th,
.compare-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

.compare-table th:first-child,
.compare-table td:first-child {
  position: sticky;
  left: 0;
  text-align: left;
  background: var(--card);
  color: var(--muted);
  font-weight: 650;
  z-index: 1;
}

.compare-table thead th {
  font-size: 0.78rem;
}

.compare-table th small {
  display: block;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 650;
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}

.pair {
  display: grid;
  justify-items: end;
}

.pair small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 650;
}

.compare-table td.best .pair b {
  color: var(--accent-2);
}

.view-analyzer .chain-scroll {
  max-height: 320px;
  flex: none;
}

.view-analyzer .heatmap {
  height: min(68dvh, 620px);
  min-height: 340px;
  margin-top: 10px;
}

.view-analyzer .controls {
  margin-top: 8px;
}

.history-card summary {
  cursor: pointer;
  list-style: none;
}

.history-card summary::-webkit-details-marker {
  display: none;
}

.history-summary {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  font-weight: 750;
}

#history-meta {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-align: right;
}

.history-card[open] .chart-toolbar {
  margin-top: 10px;
}

.history-card .chart-block {
  min-height: 180px;
}

.history-card .chart-compact {
  height: 160px;
}

.toast {
  bottom: calc(16px + env(safe-area-inset-bottom));
}

@media (min-width: 720px) {
  .payoff-chart {
    height: 280px;
  }

  .history-card .chart-compact {
    height: 200px;
  }

  .compare-table {
    font-size: 0.86rem;
  }
}

@media (max-width: 720px) {
  .view-analyzer {
    padding: 8px 10px 24px;
  }

  .quote-hero {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 8px;
    align-items: baseline;
  }

  .quote-symbol {
    grid-column: 1;
  }

  .company {
    grid-column: 2;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .quote-line {
    grid-column: 1 / -1;
  }

  .panel,
  .result-card {
    margin-top: 8px;
    padding: 10px 12px;
  }

  .scenario-card h2 {
    margin-bottom: 6px;
  }

  .field-label,
  .target-label {
    margin: 8px 0 4px;
  }

  .strike-chip {
    min-width: 64px;
    padding: 6px 8px;
  }

  .target-row input[type="number"] {
    min-height: 40px;
    padding: 6px 10px;
  }

  .move-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .hero-facts {
    margin-top: 8px;
  }
}

@media (max-width: 560px) {
  .compare-editors {
    grid-template-columns: 1fr;
  }
}
