:root {
  color-scheme: light;
  --canvas: #f5f6f8;
  --sidebar: #ffffff;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-soft: #f7f8fa;
  --surface-inset: #f0f2f5;
  --text: #171a20;
  --text-soft: #424955;
  --muted: #737b88;
  --line: #e2e5e9;
  --line-strong: #d2d6dc;
  --orange: #e96921;
  --orange-dark: #c84f0a;
  --orange-soft: #fff1e8;
  --red: #cf3f45;
  --red-soft: #fff0f1;
  --red-line: #f2c9cc;
  --green: #13865b;
  --green-soft: #eaf8f1;
  --green-line: #c4ead8;
  --blue: #2765c4;
  --blue-soft: #eef4ff;
  --shadow-sm: 0 1px 2px rgba(20, 27, 38, 0.04), 0 5px 16px rgba(20, 27, 38, 0.035);
  --shadow-md: 0 16px 44px rgba(24, 30, 40, 0.08);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --sidebar-width: 228px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #0d1015;
  --sidebar: #12161c;
  --surface: #151a21;
  --surface-raised: #191f27;
  --surface-soft: #1b222b;
  --surface-inset: #202832;
  --text: #f1f4f7;
  --text-soft: #c4cbd4;
  --muted: #939eac;
  --line: #29323e;
  --line-strong: #374251;
  --orange: #ff8748;
  --orange-dark: #ff9d69;
  --orange-soft: #382319;
  --red: #ff7379;
  --red-soft: #371f24;
  --red-line: #5a3035;
  --green: #50d49b;
  --green-soft: #19342a;
  --green-line: #295b47;
  --blue: #79a9ff;
  --blue-soft: #1a2b45;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.18), 0 8px 22px rgba(0, 0, 0, 0.12);
  --shadow-md: 0 18px 50px rgba(0, 0, 0, 0.25);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a,
input[type="range"] {
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  touch-action: manipulation;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--orange) 38%, transparent);
  outline-offset: 2px;
}

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

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 9px 13px;
  border-radius: 9px;
  color: white;
  background: var(--orange-dark);
  transform: translateY(-160%);
  transition: transform 150ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 20;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  padding: 22px 16px 18px;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
}

.brand,
.mobile-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  text-decoration: none;
}

.brand {
  padding: 0 7px;
}

.brand > span:last-child {
  display: grid;
  gap: 1px;
}

.brand strong {
  font-size: 15px;
  letter-spacing: -0.01em;
}

.brand small {
  color: var(--muted);
  font-size: 11px;
}

.brand-mark {
  display: grid;
  width: 35px;
  height: 35px;
  flex: 0 0 35px;
  place-items: center;
  border-radius: 11px;
  color: #ffffff;
  background: linear-gradient(145deg, #f68a43, var(--orange-dark));
  box-shadow: 0 7px 16px color-mix(in srgb, var(--orange) 28%, transparent);
  font-size: 17px;
  font-weight: 750;
}

.side-nav {
  display: grid;
  gap: 5px;
  margin-top: 42px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 13px;
  border-radius: 11px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 580;
  transition: color 140ms ease, background-color 140ms ease, transform 140ms ease;
}

.nav-link:hover {
  color: var(--text);
  background: var(--surface-soft);
}

.nav-link:active {
  transform: scale(0.98);
}

.nav-link.is-active {
  color: var(--orange-dark);
  background: var(--orange-soft);
}

.nav-link svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.connection-card {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
}

.connection-card > div {
  display: grid;
  gap: 2px;
}

.connection-card strong {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 650;
}

.connection-card small {
  color: var(--muted);
  font-size: 11px;
}

.connection-icon {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--muted) 15%, transparent);
}

.workspace {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.app-header {
  position: sticky;
  z-index: 40;
  top: 0;
  display: flex;
  align-items: center;
  min-height: 76px;
  padding: 12px clamp(20px, 3.5vw, 44px);
  background: color-mix(in srgb, var(--canvas) 90%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  backdrop-filter: blur(15px);
}

.mobile-brand {
  display: none;
}

.page-heading {
  display: grid;
  gap: 1px;
}

.eyebrow,
.section-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 720;
  letter-spacing: 0.1em;
}

.page-heading h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}

.trading-toggle {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 9px;
  padding: 5px 11px 5px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  color: var(--text-soft);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, transform 120ms ease, opacity 160ms ease;
}

.trading-toggle:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--red) 35%, var(--line-strong));
}

.trading-toggle:active:not(:disabled) {
  transform: scale(0.98);
}

.trading-toggle:disabled {
  cursor: wait;
  opacity: 0.7;
}

.toggle-track {
  position: relative;
  width: 34px;
  height: 20px;
  flex: 0 0 34px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--red) 65%, var(--surface-inset));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--red) 30%, transparent);
  transition: background-color 180ms ease;
}

.toggle-track > span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(20, 27, 38, 0.25);
  transition: transform 180ms ease;
}

.trading-toggle[aria-checked="true"] {
  border-color: var(--green-line);
  color: var(--green);
  background: var(--green-soft);
}

.trading-toggle[aria-checked="true"] .toggle-track {
  background: var(--green);
}

.trading-toggle[aria-checked="true"] .toggle-track > span {
  transform: translateX(14px);
}

.trading-toggle-copy {
  display: grid;
  min-width: 63px;
  gap: 0;
  text-align: left;
  line-height: 1.1;
}

.trading-toggle-copy small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 570;
}

.trading-toggle-copy strong {
  color: currentColor;
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.market-time {
  display: grid;
  gap: 1px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.market-time small {
  color: var(--muted);
  font-size: 10px;
}

.market-time strong {
  font-size: 12px;
  font-weight: 650;
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--text-soft);
  background: var(--surface);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.icon-button:hover {
  border-color: var(--line-strong);
}

.icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.moon-icon,
html[data-theme="dark"] .sun-icon {
  display: none;
}

html[data-theme="dark"] .moon-icon {
  display: block;
}

.demo-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px clamp(20px, 3.5vw, 44px) 0;
  padding: 9px 12px;
  border: 1px solid color-mix(in srgb, var(--orange) 32%, var(--line));
  border-radius: 11px;
  color: var(--text-soft);
  background: var(--orange-soft);
  font-size: 12px;
}

.demo-label {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 6px;
  color: white;
  background: var(--orange-dark);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.09em;
}

body.trading-locked [data-protected-region] {
  pointer-events: none;
  user-select: none;
}

body.trading-locked .side-nav {
  opacity: 0.38;
  filter: saturate(0.3);
}

.security-lock-panel {
  position: fixed;
  z-index: 35;
  inset: 76px 0 0 var(--sidebar-width);
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 34px 20px max(34px, env(safe-area-inset-bottom));
  color: var(--text);
  background:
    radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--orange-soft) 72%, transparent), transparent 35%),
    color-mix(in srgb, var(--canvas) 97%, transparent);
  text-align: center;
  backdrop-filter: blur(13px);
}

body:not(.trading-locked) .security-lock-panel {
  display: none;
}

.security-lock-icon,
.dialog-lock-icon {
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--orange) 25%, var(--line));
  color: var(--orange-dark);
  background: var(--orange-soft);
  box-shadow: 0 12px 32px color-mix(in srgb, var(--orange) 13%, transparent);
}

.security-lock-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 18px;
  border-radius: 20px;
}

.security-lock-icon svg,
.dialog-lock-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.security-lock-panel h2 {
  margin: 8px 0 8px;
  font-size: clamp(25px, 3vw, 34px);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.security-lock-panel > p:not(.section-kicker) {
  max-width: 475px;
  margin: 0;
  color: var(--muted);
}

.security-unlock-button {
  min-width: 190px;
  margin-top: 24px;
}

.security-lock-panel > small {
  margin-top: 12px;
  color: var(--muted);
  font-size: 10px;
}

.pin-dialog-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(7, 10, 14, 0.58);
  backdrop-filter: blur(7px);
  animation: dialog-backdrop-in 160ms ease both;
}

.pin-dialog-backdrop[hidden] {
  display: none;
}

.pin-dialog {
  position: relative;
  width: min(100%, 420px);
  padding: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  color: var(--text);
  background: var(--surface-raised);
  box-shadow: 0 28px 85px rgba(0, 0, 0, 0.28);
  animation: dialog-in 180ms ease both;
}

@keyframes dialog-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(7px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.dialog-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.dialog-close:hover {
  color: var(--text);
  background: var(--surface-soft);
}

.dialog-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.dialog-lock-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 17px;
  border-radius: 15px;
}

.dialog-lock-icon svg {
  width: 23px;
  height: 23px;
}

.pin-dialog h2 {
  margin: 7px 0 7px;
  font-size: 26px;
  letter-spacing: -0.03em;
}

.pin-dialog > p:not(.section-kicker) {
  margin: 0;
  color: var(--muted);
}

.pin-dialog form {
  margin-top: 21px;
}

.pin-dialog label {
  display: block;
  margin-bottom: 7px;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 650;
}

.pin-dialog input {
  width: 100%;
  min-height: 50px;
  padding: 10px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--text);
  background: var(--surface-soft);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.23em;
  font-variant-numeric: tabular-nums;
}

.pin-dialog input[aria-invalid="true"] {
  border-color: var(--red);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 13%, transparent);
}

.pin-confirm-field {
  margin-top: 13px;
}

.pin-confirm-field[hidden] {
  display: none;
}

.pin-error {
  min-height: 18px;
  margin: 6px 0 0;
  color: var(--red);
  font-size: 11px;
}

.dialog-actions {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 10px;
  margin-top: 13px;
}

.dialog-actions .primary-button,
.dialog-actions .secondary-button {
  width: 100%;
}

.pin-privacy {
  display: block;
  margin-top: 15px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

body.dialog-open {
  overflow: hidden;
}

main {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 26px clamp(20px, 3.5vw, 44px) 48px;
}

.view[hidden] {
  display: none;
}

.view.is-active {
  animation: view-in 220ms ease both;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

.view-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.view-intro h2 {
  margin: 5px 0 5px;
  font-size: clamp(25px, 3.3vw, 34px);
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.view-intro p:last-child {
  max-width: 610px;
  margin: 0;
  color: var(--muted);
}

.intro-meta {
  display: grid;
  min-width: 160px;
  gap: 2px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  text-align: right;
  box-shadow: var(--shadow-sm);
}

.intro-meta > span,
.intro-meta > strong {
  font-variant-numeric: tabular-nums;
}

.intro-meta > span {
  color: var(--muted);
  font-size: 11px;
}

.intro-meta > strong,
.intro-meta span strong {
  color: var(--text);
  font-size: 13px;
}

.horizontal-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px 14px;
  min-width: 220px;
}

.horizontal-meta span + span {
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

.entry-layout {
  display: grid;
  gap: 18px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.strike-card,
.sizing-card,
.positions-card {
  padding: clamp(18px, 2.5vw, 26px);
}

.card-heading,
.queue-heading,
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.card-heading h3,
.queue-heading h3 {
  margin: 3px 0 0;
  font-size: 17px;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.atm-control {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
}

.atm-control input {
  width: 104px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--text);
  background: var(--surface-soft);
  font-size: 14px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.symmetry-pill,
.status-pill,
.balanced-label {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  white-space: nowrap;
}

.symmetry-pill {
  margin: 17px 0 14px;
  padding: 6px 10px;
  color: var(--text-soft);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.strike-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(10px, 2vw, 18px);
}

.leg-column {
  min-width: 0;
}

.leg-summary {
  position: relative;
  min-height: 166px;
  padding: clamp(14px, 2.2vw, 22px);
  overflow: hidden;
  border: 1px solid;
  border-radius: 18px;
  isolation: isolate;
}

.leg-summary::after {
  position: absolute;
  z-index: -1;
  right: -34px;
  bottom: -48px;
  width: 150px;
  height: 150px;
  border: 24px solid currentColor;
  border-radius: 50%;
  content: "";
  opacity: 0.045;
}

.leg-summary-pe {
  color: var(--red);
  background: linear-gradient(145deg, var(--red-soft), color-mix(in srgb, var(--red-soft) 72%, var(--surface)));
  border-color: var(--red-line);
}

.leg-summary-ce {
  color: var(--green);
  background: linear-gradient(145deg, var(--green-soft), color-mix(in srgb, var(--green-soft) 72%, var(--surface)));
  border-color: var(--green-line);
}

.sell-label {
  display: inline-block;
  margin-bottom: 13px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.distance-value,
.strike-value {
  display: block;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.035em;
}

.distance-value {
  font-size: clamp(30px, 5vw, 48px);
  line-height: 0.95;
  font-weight: 790;
}

.distance-value small {
  font-size: 0.43em;
  letter-spacing: 0.01em;
}

.distance-copy {
  display: block;
  margin-top: 5px;
  color: currentColor;
  font-size: 12px;
  opacity: 0.74;
}

.strike-value {
  margin-top: 16px;
  font-size: clamp(20px, 3.6vw, 31px);
  line-height: 1;
  font-weight: 760;
}

.strike-value small {
  font-size: 0.58em;
  letter-spacing: 0;
}

.slider-wrap {
  padding: 18px 6px 2px;
}

.strike-range {
  width: 100%;
  height: 24px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: grab;
}

.strike-range:active {
  cursor: grabbing;
}

.strike-range::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 28%, var(--surface-inset));
}

.strike-range::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 28%, var(--surface-inset));
}

.strike-range::-webkit-slider-thumb {
  width: 21px;
  height: 21px;
  margin-top: -7.5px;
  border: 4px solid var(--surface);
  border-radius: 50%;
  appearance: none;
  -webkit-appearance: none;
  background: currentColor;
  box-shadow: 0 0 0 1px color-mix(in srgb, currentColor 50%, transparent), 0 3px 7px rgba(0, 0, 0, 0.18);
}

.strike-range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 4px solid var(--surface);
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 1px color-mix(in srgb, currentColor 50%, transparent), 0 3px 7px rgba(0, 0, 0, 0.18);
}

.pe-range { color: var(--red); }
.ce-range { color: var(--green); }

.axis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.axis span {
  min-width: 0;
  text-align: center;
}

.axis span:first-child { text-align: left; }
.axis span:last-child { text-align: right; }

.axis-title {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  text-align: center;
  font-size: 10px;
}

.sizing-heading {
  margin-bottom: 15px;
}

.status-pill {
  gap: 7px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 650;
}

.status-pill > span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-ready {
  color: var(--green);
  background: var(--green-soft);
}

.status-stale {
  color: var(--orange-dark);
  background: var(--orange-soft);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--line);
}

.stat {
  display: grid;
  align-content: center;
  min-height: 74px;
  gap: 5px;
  padding: 12px 14px;
  background: var(--surface-soft);
}

.stat > span {
  color: var(--muted);
  font-size: 10px;
}

.stat strong {
  font-size: 14px;
  font-weight: 680;
  font-variant-numeric: tabular-nums;
}

.stat strong small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 550;
}

.quantity-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 11px;
}

.quantity-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 3px 12px;
  padding: 13px 15px;
  border: 1px solid;
  border-radius: 14px;
}

.quantity-card > span {
  grid-column: 1 / -1;
  font-size: 10px;
}

.quantity-card > strong {
  font-size: clamp(22px, 3vw, 29px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.025em;
}

.quantity-card > small {
  align-self: end;
  opacity: 0.78;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.quantity-pe {
  color: var(--red);
  border-color: var(--red-line);
  background: var(--red-soft);
}

.quantity-ce {
  color: var(--green);
  border-color: var(--green-line);
  background: var(--green-soft);
}

.queue-heading {
  align-items: flex-end;
  margin: 22px 0 8px;
}

.queue-heading h3 {
  font-size: 14px;
}

.queue-heading > small {
  color: var(--muted);
  font-size: 10px;
}

.queue-table {
  border-top: 1px solid var(--line);
}

.queue-row {
  display: grid;
  grid-template-columns: 34px 82px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 47px;
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}

.queue-number,
.queue-state {
  color: var(--muted);
  font-size: 10px;
}

.queue-time {
  font-size: 12px;
  font-weight: 680;
}

.queue-legs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.queue-leg {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10px;
  white-space: nowrap;
}

.queue-leg-pe { color: var(--red); background: var(--red-soft); }
.queue-leg-ce { color: var(--green); background: var(--green-soft); }

.empty-queue {
  display: block;
  padding: 16px 0;
  color: var(--muted);
  font-size: 11px;
}

.entry-actions {
  display: flex;
  gap: 10px;
  margin-top: 17px;
}

.primary-button,
.secondary-button {
  min-height: 42px;
  padding: 9px 15px;
  border-radius: 11px;
  cursor: pointer;
  font-weight: 650;
  transition: transform 120ms ease, filter 120ms ease, opacity 120ms ease;
}

.primary-button:active,
.secondary-button:active {
  transform: translateY(1px);
}

.primary-button {
  flex: 1;
  border: 1px solid var(--orange);
  color: #ffffff;
  background: var(--orange);
  box-shadow: 0 7px 17px color-mix(in srgb, var(--orange) 20%, transparent);
}

html[data-theme="dark"] .primary-button {
  color: #24140b;
}

.primary-button:hover,
.secondary-button:hover { filter: brightness(0.98); }

.secondary-button {
  border: 1px solid var(--line-strong);
  color: var(--text);
  background: var(--surface);
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  filter: none;
  opacity: 0.48;
  box-shadow: none;
}

.helper-text {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 10px;
}

/* Positions */
.eod-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(230px, 0.9fr) minmax(300px, 1.1fr);
  align-items: end;
  gap: 24px;
  margin-bottom: 18px;
  padding: clamp(20px, 3vw, 30px);
  overflow: hidden;
  border: 1px solid var(--green-line);
  border-radius: var(--radius-lg);
  color: var(--green);
  background: linear-gradient(125deg, var(--green-soft), color-mix(in srgb, var(--green-soft) 62%, var(--surface)));
  box-shadow: var(--shadow-sm);
}

.eod-card::after {
  position: absolute;
  right: -70px;
  top: -95px;
  width: 240px;
  height: 240px;
  border: 35px solid currentColor;
  border-radius: 50%;
  content: "";
  opacity: 0.035;
}

.eod-card p {
  margin: 0 0 8px;
  font-size: 10px;
  font-weight: 780;
  letter-spacing: 0.1em;
}

.eod-value {
  display: block;
  font-size: clamp(38px, 6vw, 58px);
  line-height: 0.95;
  font-weight: 760;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}

.profit-equation {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}

.profit-equation > span {
  display: grid;
  gap: 3px;
}

.profit-equation small {
  opacity: 0.78;
}

.profit-equation strong {
  font-size: clamp(19px, 3vw, 27px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.profit-equation b {
  font-size: 22px;
  font-weight: 400;
  opacity: 0.6;
}

.estimate-note {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 10px;
}

.balanced-label {
  gap: 6px;
  padding: 6px 9px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 10px;
  font-weight: 650;
}

.balanced-label > span {
  font-size: 15px;
  line-height: 1;
}

.responsive-table {
  margin-top: 14px;
  border-top: 1px solid var(--line);
}

.table-head,
.position-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) repeat(3, minmax(80px, 0.65fr)) minmax(105px, 0.8fr);
  align-items: center;
  gap: 12px;
}

.table-head {
  min-height: 39px;
  color: var(--muted);
  font-size: 10px;
}

.table-head span:not(:first-child) {
  text-align: right;
}

.table-row {
  border-top: 1px solid var(--line);
}

.position-row {
  min-height: 75px;
}

.instrument-cell {
  display: grid;
  justify-items: start;
  gap: 5px;
}

.instrument-cell small {
  color: var(--muted);
  font-size: 9px;
}

.option-chip,
.order-side,
.order-status {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border-radius: 999px;
  white-space: nowrap;
}

.option-chip {
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 680;
  font-variant-numeric: tabular-nums;
}

.option-pe { color: var(--red); background: var(--red-soft); }
.option-ce { color: var(--green); background: var(--green-soft); }

.numeric-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.positive {
  color: var(--green);
  font-weight: 680;
}

/* Orders */
.orderbook-card {
  overflow: hidden;
}

.order-tabs {
  display: flex;
  gap: 0;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}

.order-tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 18px 14px;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 650;
}

.order-tab > span {
  min-width: 23px;
  padding: 2px 7px;
  border-radius: 999px;
  color: inherit;
  background: var(--surface-soft);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.order-tab[aria-selected="true"] {
  color: var(--orange-dark);
}

.order-tab[aria-selected="true"]::after {
  position: absolute;
  right: 14px;
  bottom: -1px;
  left: 14px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--orange);
  content: "";
}

.orders-panel {
  padding: 0 20px 5px;
}

.orders-panel[hidden] {
  display: none;
}

.panel-heading {
  min-height: 54px;
}

.panel-heading strong {
  font-size: 13px;
}

.panel-heading small {
  color: var(--muted);
  font-size: 10px;
}

.orders-table {
  margin-top: 0;
}

.order-head,
.order-row {
  display: grid;
  grid-template-columns: 68px 52px minmax(180px, 1.35fr) 55px 80px 80px 92px;
  align-items: center;
  gap: 9px;
}

.order-head {
  min-height: 37px;
  color: var(--muted);
  font-size: 10px;
}

.order-head span:nth-child(n + 5) {
  text-align: right;
}

.order-row {
  min-height: 65px;
  border-top: 1px solid var(--line);
  font-size: 11px;
}

.order-time,
.order-number {
  font-variant-numeric: tabular-nums;
}

.order-side {
  justify-content: center;
  padding: 4px 7px;
  color: var(--red);
  background: var(--red-soft);
  font-size: 9px;
  font-weight: 740;
}

.order-instrument {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.order-instrument strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.order-instrument small {
  color: var(--muted);
  font-size: 9px;
}

.instrument-pe { color: var(--red); }
.instrument-ce { color: var(--green); }

.order-number {
  text-align: right;
}

.order-status {
  justify-self: end;
  justify-content: center;
  min-width: 68px;
  padding: 5px 8px;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.order-status-open { color: var(--orange-dark); background: var(--orange-soft); }
.order-status-complete { color: var(--green); background: var(--green-soft); }

.bottom-nav {
  display: none;
}

.toast {
  position: fixed;
  z-index: 50;
  right: 22px;
  bottom: 22px;
  max-width: min(360px, calc(100vw - 32px));
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--text);
  background: var(--surface-raised);
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1050px) {
  :root { --sidebar-width: 190px; }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .eod-card {
    grid-template-columns: 1fr 1fr;
  }

  .order-head,
  .order-row {
    grid-template-columns: 64px 48px minmax(160px, 1.25fr) 49px 72px 74px 82px;
    gap: 7px;
  }
}

@media (max-width: 820px) {
  :root { --sidebar-width: 0px; }

  body { padding-bottom: 74px; }

  .sidebar { display: none; }

  .workspace { margin-left: 0; }

  .app-header {
    min-height: 67px;
    padding: 10px 18px;
  }

  .security-lock-panel {
    inset: 67px 0 0;
    padding-bottom: calc(88px + env(safe-area-inset-bottom));
  }

  .mobile-brand { display: flex; }
  .mobile-brand .brand-mark { width: 32px; height: 32px; flex-basis: 32px; font-size: 15px; }
  .mobile-brand strong { font-size: 14px; }
  .page-heading { display: none; }

  .demo-banner { margin: 13px 16px 0; }

  main { padding: 22px 16px 32px; }

  .bottom-nav {
    position: fixed;
    z-index: 30;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    min-height: 64px;
    padding: 5px max(8px, env(safe-area-inset-right)) max(5px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(15px);
  }

  .bottom-nav .nav-link {
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    min-height: 51px;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 10px;
  }

  .bottom-nav .nav-link svg { width: 19px; height: 19px; }
  .bottom-nav .nav-link.is-active { background: transparent; }

  .toast { right: 16px; bottom: 78px; }
}

@media (max-width: 680px) {
  .view-intro {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .view-intro h2 { font-size: 27px; }

  .intro-meta {
    width: 100%;
    min-width: 0;
    text-align: left;
  }

  .horizontal-meta { justify-content: flex-start; }

  .leg-summary { min-height: 151px; }
  .distance-value { font-size: clamp(29px, 8vw, 40px); }
  .strike-value { font-size: clamp(20px, 6vw, 27px); }

  .axis span:nth-child(even) { display: none; }
  .axis { grid-template-columns: repeat(3, minmax(0, 1fr)); font-size: 9px; }

  .eod-card {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .estimate-note { grid-column: auto; }

  .table-head { display: none; }

  .position-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
    padding: 16px 0;
  }

  .instrument-cell { grid-column: 1 / -1; }

  .numeric-cell { text-align: left; }

  .numeric-cell::before {
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    content: attr(data-label);
    font-size: 9px;
    font-weight: 450;
  }

  .order-head { display: none; }

  .order-row {
    grid-template-columns: auto 1fr auto;
    gap: 9px 10px;
    padding: 13px 0;
  }

  .order-time { grid-column: 1; }
  .order-side { grid-column: 2; justify-self: start; }
  .order-status { grid-column: 3; grid-row: 1; }
  .order-instrument { grid-column: 1 / -1; }

  .order-product,
  .order-qty,
  .order-price {
    text-align: left;
  }

  .order-product::before,
  .order-qty::before,
  .order-price::before {
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    content: attr(data-label);
    font-size: 9px;
  }
}

@media (max-width: 480px) {
  .app-header { padding-inline: 14px; }

  .header-actions { gap: 7px; }

  .trading-toggle {
    min-height: 38px;
    gap: 7px;
    padding: 4px 8px 4px 6px;
    border-radius: 11px;
  }

  .toggle-track {
    width: 30px;
    height: 18px;
    flex-basis: 30px;
  }

  .toggle-track > span {
    width: 12px;
    height: 12px;
  }

  .trading-toggle[aria-checked="true"] .toggle-track > span {
    transform: translateX(12px);
  }

  .trading-toggle-copy { min-width: 44px; }
  .trading-toggle-copy small { display: none; }
  .trading-toggle-copy strong { font-size: 10px; }

  .market-time { display: none; }

  .demo-banner {
    align-items: flex-start;
    margin-inline: 12px;
    font-size: 11px;
  }

  main { padding: 19px 12px 28px; }

  .view-intro { margin-bottom: 17px; }

  .strike-card,
  .sizing-card,
  .positions-card { padding: 14px; border-radius: 17px; }

  .card-heading { align-items: flex-start; }

  .strike-card .card-heading {
    flex-direction: column;
    gap: 12px;
  }

  .atm-control { width: 100%; justify-content: space-between; }
  .atm-control input { width: 110px; }

  .symmetry-pill { margin-block: 13px 11px; }

  .strike-grid { gap: 8px; }

  .leg-summary {
    min-height: 145px;
    padding: 13px 11px;
    border-radius: 14px;
  }

  .sell-label { margin-bottom: 10px; }
  .distance-value { font-size: clamp(27px, 9.2vw, 37px); }
  .distance-copy { font-size: 10px; }
  .strike-value { margin-top: 14px; font-size: clamp(19px, 6.4vw, 25px); }

  .slider-wrap { padding: 14px 1px 0; }
  .axis { font-size: 8px; }

  .sizing-heading { align-items: flex-start; flex-direction: column; }

  .stat { min-height: 68px; padding: 10px; }
  .stat strong { font-size: 12px; }

  .quantity-card {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 2px;
    padding: 11px;
  }

  .quantity-card > strong { font-size: 23px; }

  .queue-heading { align-items: flex-start; flex-direction: column; gap: 5px; }

  .queue-row {
    grid-template-columns: 25px 68px minmax(0, 1fr);
    gap: 6px;
    padding: 8px 0;
  }

  .queue-state { grid-column: 3; }
  .queue-leg { padding: 3px 6px; font-size: 9px; }

  .entry-actions { flex-direction: column; }
  .primary-button { order: -1; }

  .eod-card { padding: 19px 16px; border-radius: 17px; }
  .eod-value { font-size: 42px; }
  .profit-equation { gap: 8px; }
  .profit-equation strong { font-size: 19px; }

  .positions-card .card-heading { align-items: center; }

  .order-tabs { padding: 0 6px; }
  .order-tab { flex: 1; justify-content: center; padding-inline: 9px; }
  .orders-panel { padding-inline: 13px; }
  .panel-heading { align-items: flex-start; flex-direction: column; justify-content: center; gap: 2px; }

  .security-lock-panel {
    padding-inline: 24px;
  }

  .security-lock-icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
  }

  .security-lock-panel h2 { font-size: 27px; }

  .pin-dialog-backdrop {
    align-items: end;
    padding: 0;
  }

  .pin-dialog {
    width: 100%;
    padding: 25px 20px calc(20px + env(safe-area-inset-bottom));
    border-radius: 22px 22px 0 0;
  }

  .pin-dialog h2 { font-size: 24px; }
}

@media (max-width: 360px) {
  .mobile-brand { gap: 7px; }
  .mobile-brand strong { font-size: 12px; }
  .mobile-brand .brand-mark { width: 29px; height: 29px; flex-basis: 29px; }
  .trading-toggle-copy { min-width: 36px; }
  .trading-toggle { gap: 5px; padding-right: 6px; }
  .icon-button { width: 35px; height: 35px; }
}
