:root {
  color-scheme: dark;
  --bg: #07090f;
  --panel: #101620;
  --panel-2: #151d28;
  --line: #263244;
  --text: #f4f7fb;
  --muted: #9aa4b2;
  --cyan: #64e6ee;
  --pink: #ec4899;
  --gold: #f6c84c;
  --green: #6ee7a8;
  --danger: #fb7185;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #061016;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.lock-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(6, 16, 22, 0.94);
  backdrop-filter: blur(10px);
}

.lock-screen[hidden] {
  display: none;
}

.login-panel {
  width: min(420px, 100%);
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 22, 32, 0.98);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.login-panel h1 {
  margin-bottom: 22px;
}

.login-panel input {
  height: 44px;
  width: 100%;
  color: var(--text);
  background: #080c13;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
}

.login-panel button {
  width: 100%;
  height: 44px;
  margin-top: 14px;
  border: 0;
  border-radius: 6px;
  color: #061016;
  background: var(--gold);
  font-weight: 900;
  cursor: pointer;
}

.login-error {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--danger);
  font-size: 0.9rem;
}

button,
select,
input {
  font: inherit;
}

.shell {
  width: min(1680px, calc(100vw - 16px));
  margin: 0 auto;
  padding: 10px 0 24px;
}

.topbar,
.controls,
.stats,
.prices,
.events,
.earnings-list,
.workspace {
  display: grid;
  gap: 16px;
}

.topbar {
  grid-template-columns: 1fr auto;
  align-items: end;
  margin-bottom: 10px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(1.45rem, 3vw, 2.4rem);
}

h2 {
  font-size: 1.35rem;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.market-status {
  display: inline-grid;
  place-items: center;
  min-width: 92px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--gold);
  background: rgba(246, 200, 76, 0.08);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.market-status.open {
  color: var(--green);
  background: rgba(110, 231, 168, 0.09);
  border-color: rgba(110, 231, 168, 0.42);
}

.market-status.extended {
  color: var(--gold);
  background: rgba(246, 200, 76, 0.1);
  border-color: rgba(246, 200, 76, 0.48);
}

.market-status.closed {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: var(--gold);
  box-shadow: 0 0 22px currentColor;
}

.dot.live {
  background: var(--green);
}

.dot.error {
  background: var(--danger);
}

.controls {
  grid-template-columns: auto minmax(130px, 0.8fr) minmax(160px, 1fr) auto auto auto auto;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 22, 32, 0.84);
  margin-bottom: 10px;
}

.segmented {
  display: inline-grid;
  grid-template-columns: repeat(2, 80px);
  gap: 4px;
  padding: 4px;
  background: #080c13;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.segment {
  height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.segment.is-active {
  color: #061016;
  background: var(--cyan);
  font-weight: 800;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

select,
input[type="range"] {
  width: 100%;
}

select {
  height: 36px;
  color: var(--text);
  background: #080c13;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
}

.toggle {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.install-button {
  height: 44px;
  min-width: 96px;
  border: 0;
  border-radius: 6px;
  color: #061016;
  background: var(--gold);
  font-weight: 900;
  cursor: pointer;
}

.install-button[hidden] {
  display: none;
}

.stats {
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  margin-bottom: 10px;
}

.quick-strip {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(16, 22, 32, 0.62);
}

.preset-group {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.preset-button {
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.74rem;
  font-weight: 800;
  cursor: pointer;
}

.preset-button:hover {
  border-color: rgba(100, 230, 238, 0.55);
  color: var(--cyan);
}

.data-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: right;
}

.disclaimer-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(6, 16, 22, 0.74);
  backdrop-filter: blur(8px);
}

.disclaimer-modal[hidden] {
  display: none;
}

.disclaimer-panel {
  width: min(440px, 100%);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 22, 32, 0.98);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.disclaimer-panel p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.5;
}

.disclaimer-panel button {
  width: 100%;
  height: 42px;
  border: 0;
  border-radius: 6px;
  color: #061016;
  background: var(--gold);
  font-weight: 900;
  cursor: pointer;
}

.share-safe #events-updated,
.share-safe #earnings-watchlist,
.share-safe .data-status,
.share-safe .site-footer span:last-child {
  display: none;
}

.prices {
  grid-template-columns: repeat(5, minmax(120px, 1fr)) minmax(190px, 1.3fr);
  margin-bottom: 10px;
}

.events-panel,
.earnings-panel {
  margin-bottom: 8px;
}

.stats article,
.prices article,
.events-panel,
.event-card,
.earnings-panel,
.earnings-card,
.chart-panel,
.side-panel,
.orders-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 22, 32, 0.9);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.26);
}

.stats article {
  padding: 12px 14px;
}

.prices article {
  padding: 12px 14px;
}

.events-panel,
.earnings-panel {
  padding: 9px;
}

.events,
.earnings-list {
  grid-template-columns: repeat(6, minmax(140px, 1fr));
  gap: 8px;
}

.event-card,
.earnings-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 62px;
  padding: 9px;
  background: rgba(21, 29, 40, 0.76);
}

.event-card.high,
.earnings-card.high {
  border-color: rgba(251, 113, 133, 0.72);
}

.event-card.medium,
.earnings-card.medium {
  border-color: rgba(246, 200, 76, 0.72);
}

.event-card.urgent,
.earnings-card.urgent {
  background: linear-gradient(90deg, rgba(251, 113, 133, 0.16), rgba(21, 29, 40, 0.82));
  box-shadow: inset 4px 0 0 var(--danger), 0 18px 42px rgba(251, 113, 133, 0.14);
}

.event-card strong,
.earnings-card strong {
  display: block;
  font-size: 0.94rem;
}

.event-card span,
.earnings-card span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.72rem;
}

.event-card b,
.earnings-move b {
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  height: 28px;
  border-radius: 999px;
  color: #061016;
  background: var(--gold);
  font-size: 0.78rem;
}

.earnings-card.empty {
  grid-template-columns: 1fr;
  color: var(--muted);
  font-size: 0.82rem;
}

.skeleton-card,
.panel-error-card {
  min-height: 62px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(21, 29, 40, 0.76);
  font-size: 0.82rem;
}

.skeleton-card {
  overflow: hidden;
  color: transparent;
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent),
    rgba(21, 29, 40, 0.76);
  background-size: 220% 100%;
  animation: skeleton-sheen 1.4s ease-in-out infinite;
}

.skeleton-card:first-child {
  color: var(--muted);
}

.panel-error-card {
  border-color: rgba(251, 113, 133, 0.54);
}

@keyframes skeleton-sheen {
  0% {
    background-position: 220% 0;
  }

  100% {
    background-position: -220% 0;
  }
}

.earnings-move {
  text-align: right;
}

#earnings-watchlist {
  display: inline-block;
  max-width: min(48vw, 560px);
  overflow: hidden;
  vertical-align: bottom;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.earnings-card.high .earnings-move b {
  background: var(--danger);
}

.earnings-card.medium .earnings-move b {
  background: var(--gold);
}

.stats span,
.prices span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  font-weight: 800;
}

.stats strong {
  display: block;
  margin-top: 6px;
  font-size: clamp(1.05rem, 1.5vw, 1.35rem);
}

.prices strong {
  display: block;
  margin-top: 6px;
  font-size: 1.08rem;
}

.wide-price strong {
  color: var(--gold);
  font-size: 0.98rem;
}

.workspace {
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: start;
}

.chart-panel,
.side-panel,
.orders-panel {
  padding: 10px;
}

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

.wall-summary article {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(21, 29, 40, 0.76);
}

.wall-summary span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.wall-summary strong {
  display: block;
  margin-top: 6px;
  font-size: 1.08rem;
}

.panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.panel-head p,
.panel-head span {
  color: var(--muted);
  margin: 0;
}

.panel-head b {
  font-weight: 800;
  color: var(--text);
}

.compact {
  align-items: center;
}

.heatmap {
  display: grid;
  grid-template-columns: 84px repeat(var(--cols), minmax(132px, 1fr)) 96px;
  gap: 0;
  overflow-x: auto;
  max-height: 680px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #102b39;
}

.axis,
.cell {
  min-height: 25px;
  border-radius: 0;
}

.axis {
  display: grid;
  place-items: center;
  color: #dbeafe;
  background: #071018;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
}

.strike-axis {
  justify-items: center;
  padding-right: 10px;
  color: #ecfeff;
  font-weight: 800;
}

.expiry-axis {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 26px;
  color: #a7f3d0;
  background: #071018;
  font-weight: 800;
}

.live-header-axis {
  position: sticky;
  right: 0;
  top: 0;
  z-index: 3;
  color: var(--gold);
  background: #071018;
}

.corner-axis {
  position: sticky;
  left: 0;
  top: 0;
  z-index: 3;
  color: var(--gold);
}

.strike-axis {
  position: sticky;
  left: 0;
  z-index: 1;
}

.live-price-axis {
  position: sticky;
  right: 0;
  z-index: 1;
  padding: 0 8px;
  background: rgba(7, 16, 24, 0.95);
}

.live-price-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 78px;
  height: 20px;
  border-radius: 999px;
  color: #071018;
  background: var(--gold);
  font-size: 0.72rem;
  font-weight: 900;
  box-shadow: 0 0 20px rgba(246, 200, 76, 0.55);
}

.cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 132px;
  padding: 0 10px;
  background: rgba(37, 108, 129, 0.42);
  border-right: 1px solid rgba(255, 255, 255, 0.035);
  border-bottom: 1px solid rgba(255, 255, 255, 0.035);
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.cell.incoming-order {
  outline: 2px solid rgba(255, 255, 255, 0.72);
  outline-offset: -2px;
  animation: incoming-pulse 1.1s ease-out 3;
}

.incoming-badge {
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  min-width: 44px;
  max-width: 64px;
  overflow: hidden;
  color: #061016;
  background: #fff7ed;
  border-radius: 999px;
  padding: 2px 6px;
  font-size: 0.64rem;
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
  text-overflow: ellipsis;
}

@keyframes incoming-pulse {
  0% {
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.95), 0 0 0 rgba(246, 200, 76, 0);
  }

  100% {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 0 22px rgba(246, 200, 76, 0.44);
  }
}

.cell.order-big {
  color: #fff7ed;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), inset 4px 0 0 #fecaca;
}

.cell.order-medium {
  color: #fffbea;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.empty-cell {
  color: rgba(255, 255, 255, 0.34);
}

.spot-row .cell,
.spot-row .axis {
  box-shadow: inset 0 2px 0 var(--gold), inset 0 -2px 0 var(--gold);
}

.legend {
  display: flex;
  justify-content: center;
  gap: 26px;
  color: var(--muted);
  font-size: 0.95rem;
  padding-top: 14px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.legend i {
  display: inline-block;
}

.positive,
.negative,
.big-order,
.medium-order,
.small-order {
  width: 34px;
  height: 13px;
  border-radius: 999px;
}

.positive {
  background: var(--cyan);
}

.negative {
  background: var(--pink);
}

.big-order {
  background: #ef4444;
}

.medium-order {
  background: var(--gold);
}

.small-order {
  background: #256c81;
}

.spot-line {
  width: 34px;
  border-top: 3px dashed var(--gold);
}

.levels {
  display: grid;
  gap: 9px;
}

.level {
  position: relative;
  display: grid;
  grid-template-columns: minmax(88px, 1fr) 92px 58px;
  gap: 10px;
  align-items: center;
  min-height: 64px;
  padding: 10px;
  overflow: hidden;
  background: rgba(21, 29, 40, 0.88);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.level::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--volume);
  opacity: 0.26;
}

.level.call::before {
  background: linear-gradient(90deg, var(--cyan), transparent);
}

.level.put::before {
  background: linear-gradient(90deg, var(--pink), transparent);
}

.level > * {
  position: relative;
}

.level strong,
.level-score b {
  display: block;
  font-size: 1rem;
}

.level span,
.level-score span {
  color: var(--muted);
  font-size: 0.72rem;
}

.level-meter {
  height: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}

.level-meter i {
  display: block;
  width: var(--volume);
  height: 100%;
  border-radius: inherit;
}

.level.call .level-meter i {
  background: var(--cyan);
}

.level.put .level-meter i {
  background: var(--pink);
}

.level-score {
  text-align: right;
}

.chance-high {
  border-color: rgba(110, 231, 168, 0.74);
}

.chance-high .level-score b,
.edge-pill.chance-high {
  color: var(--green);
}

.chance-medium {
  border-color: rgba(246, 200, 76, 0.7);
}

.chance-medium .level-score b,
.edge-pill.chance-medium {
  color: var(--gold);
}

.chance-low {
  border-color: rgba(251, 113, 133, 0.58);
}

.chance-low .level-score b,
.edge-pill.chance-low {
  color: var(--danger);
}

.orders-panel {
  margin-top: 16px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 2px 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.site-footer b {
  color: var(--gold);
  font-weight: 900;
}

.footer-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.text-button {
  border: 0;
  color: var(--gold);
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

.orders-wrap {
  max-height: 470px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.orders-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.orders-table th,
.orders-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  text-align: right;
  white-space: nowrap;
}

.orders-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: #0b1018;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.orders-table th:first-child,
.orders-table td:first-child,
.orders-table th:nth-child(2),
.orders-table td:nth-child(2),
.orders-table th:nth-child(3),
.orders-table td:nth-child(3) {
  text-align: left;
}

.orders-table tr {
  background: rgba(21, 29, 40, 0.48);
}

.orders-table tr.significant {
  background: linear-gradient(90deg, rgba(246, 200, 76, 0.2), rgba(21, 29, 40, 0.72));
  outline: 1px solid rgba(246, 200, 76, 0.4);
}

.orders-table tr.significant.call {
  box-shadow: inset 4px 0 0 var(--cyan);
}

.orders-table tr.significant.put {
  box-shadow: inset 4px 0 0 var(--pink);
}

.flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 86px;
  height: 24px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.significant .flag {
  color: #07090f;
  background: var(--gold);
}

.contract-type {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  color: #061016;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.contract-type.call {
  background: var(--cyan);
}

.contract-type.put {
  background: var(--pink);
}

.edge-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.72rem;
  font-weight: 900;
}

.number-positive {
  color: var(--cyan);
}

.number-negative {
  color: var(--pink);
}

@media (max-width: 980px) {
  .controls,
  .stats,
  .prices,
  .events,
  .earnings-list,
  .wall-summary,
  .workspace {
    grid-template-columns: 1fr;
  }

  .topbar {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .quick-strip {
    grid-template-columns: 1fr;
  }

  .data-status {
    text-align: left;
  }

  .status {
    justify-content: flex-start;
  }

  .site-footer,
  .footer-actions {
    align-items: flex-start;
    justify-content: flex-start;
  }

  .site-footer {
    flex-direction: column;
  }

  .shell {
    width: min(100vw - 10px, 1680px);
    padding-top: 6px;
  }

  .heatmap {
    max-height: 560px;
    grid-template-columns: 74px repeat(var(--cols), minmax(104px, 1fr)) 84px;
  }

  .cell {
    min-width: 104px;
    padding: 0 7px;
    font-size: 0.66rem;
  }

  .axis {
    font-size: 0.68rem;
  }

  .legend {
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.82rem;
  }

  #earnings-watchlist {
    max-width: 70vw;
  }
}
