:root {
  --bg: #f4efe4;
  --bg-accent: #efe2c5;
  --panel: rgba(255, 251, 243, 0.88);
  --ink: #1f2430;
  --muted: #5f6758;
  --line: rgba(31, 36, 48, 0.12);
  --brand: #b85c38;
  --brand-soft: rgba(184, 92, 56, 0.14);
  --accent: #296b73;
  --good: #2f6b48;
  --bad: #a14032;
  --shadow: 0 18px 40px rgba(78, 54, 28, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(184, 92, 56, 0.14), transparent 32%),
    radial-gradient(circle at top right, rgba(41, 107, 115, 0.16), transparent 28%),
    linear-gradient(180deg, var(--bg-accent), var(--bg));
  font-family: "Avenir Next", "Helvetica Neue", "Segoe UI", sans-serif;
}

.page-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

.hero {
  display: grid;
  grid-template-columns: 1.6fr 0.9fr;
  gap: 24px;
  align-items: end;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
  color: var(--brand);
}

.page-links {
  display: flex;
  gap: 10px;
  margin: 0 0 14px;
}

.page-links a {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(31, 36, 48, 0.06);
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.page-links a[aria-current="page"] {
  background: var(--brand-soft);
  color: var(--brand);
}

.account-switcher {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.account-current {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  max-width: min(520px, 48vw);
  border: 1px solid rgba(31, 36, 48, 0.12);
  border-radius: 999px;
  padding: 0 12px;
  background: rgba(255, 251, 243, 0.86);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-switcher .account-logout {
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(161, 64, 50, 0.1);
  color: var(--bad);
}

h1, h2 {
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  margin: 0;
}

h1 {
  font-size: clamp(40px, 6vw, 72px);
  line-height: 0.95;
}

h2 {
  font-size: 28px;
}

.lede,
.muted {
  color: var(--muted);
}

.quote-source-snapshot {
  color: var(--bad);
  font-weight: 600;
}

.lede {
  max-width: 760px;
  line-height: 1.6;
  margin-top: 14px;
}

.active-symbol-label {
  margin: 14px 0 0;
  color: var(--accent);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.playbook-link {
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
}

.playbook-link:hover {
  text-decoration: underline;
}

.home-shell {
  max-width: 980px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.home-hero {
  margin-bottom: 22px;
}

.home-hero h1 {
  font-size: clamp(42px, 7vw, 68px);
}

.home-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.home-quick-trade-panel {
  padding: 20px;
}

.home-quick-trade-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 110px auto;
  gap: 12px;
  align-items: end;
}

.home-quick-trade-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.home-quick-trade-form input {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(31, 36, 48, 0.14);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  font: inherit;
  font-size: 15px;
  letter-spacing: 0;
}

.home-quick-trade-form button {
  min-height: 42px;
  border-radius: 8px;
}

.home-tool-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.home-tool-link {
  display: grid;
  gap: 8px;
  min-height: 104px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 251, 243, 0.78);
  box-shadow: 0 12px 28px rgba(78, 54, 28, 0.1);
  text-decoration: none;
}

.home-tool-link:hover {
  border-color: rgba(184, 92, 56, 0.32);
  transform: translateY(-1px);
}

.home-tool-title {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
}

.home-tool-subtitle {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.home-research-section {
  display: grid;
  gap: 12px;
  padding-top: 4px;
}

.home-research-heading {
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.home-research-heading h2 {
  font-family: inherit;
  font-size: 18px;
  line-height: 1.2;
}

.home-research-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.home-research-group {
  min-width: 0;
}

.home-research-group + .home-research-group {
  border-left: 1px solid var(--line);
  padding-left: 18px;
}

.home-research-group h3 {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.home-research-links {
  display: grid;
}

.home-research-link {
  display: grid;
  gap: 2px;
  min-width: 0;
  min-height: 48px;
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
  color: var(--ink);
  text-decoration: none;
}

.home-research-link:hover span {
  color: var(--brand);
}

.home-research-link span {
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.25;
}

.home-research-link small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

@media (max-width: 760px) {
  .home-research-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .home-research-group + .home-research-group {
    border-top: 1px solid var(--line);
    border-left: 0;
    padding-top: 16px;
    padding-left: 0;
  }
}

.controls,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.controls {
  padding: 18px;
  border-radius: 22px;
  display: grid;
  gap: 10px;
}

.manual-collect-panel {
  border-top: 1px dashed rgba(31, 36, 48, 0.14);
  padding-top: 10px;
}

.compare-filter-panel {
  border-top: 1px dashed rgba(31, 36, 48, 0.14);
  padding-top: 10px;
}

.manual-collect-panel summary {
  cursor: pointer;
  color: var(--brand);
  font-weight: 700;
  list-style: none;
}

.compare-filter-panel summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 700;
  list-style: none;
}

.manual-collect-panel summary::-webkit-details-marker {
  display: none;
}

.compare-filter-panel summary::-webkit-details-marker {
  display: none;
}

.compare-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
  align-items: end;
}

.manual-collect-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
  align-items: end;
}

.manual-collect-hint {
  margin: 10px 0 6px;
  line-height: 1.5;
}

#manual-refresh-status,
#expiry-refresh-status,
#position-switch-status,
#manual-collect-status,
#ladder-refresh-status {
  min-height: 20px;
}

#manual-refresh-status.status-error,
#expiry-refresh-status.status-error,
#position-switch-status.status-error,
#ladder-refresh-status.status-error {
  color: var(--bad);
  font-weight: 600;
}

#manual-refresh-status {
  margin-top: -2px;
}

.filter-panel {
  padding: 14px 16px;
}

.tape-controls {
  display: grid;
  gap: 10px;
}

.quick-filters {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) 120px 140px;
  gap: 10px;
  align-items: end;
}

.advanced-filters {
  border-top: 1px dashed rgba(31, 36, 48, 0.12);
  padding-top: 8px;
}

.secondary-btn {
  background: rgba(31, 36, 48, 0.08);
  color: var(--ink);
}

.compact-refresh-btn {
  width: auto;
  min-width: 0;
  padding: 8px 12px;
  border-radius: 11px;
  font-size: 14px;
  line-height: 1.2;
  flex: 0 0 auto;
}

.control-field {
  min-width: 150px;
  flex: 1 1 160px;
  display: grid;
  gap: 8px;
  position: relative;
}

.symbol-picker {
  position: relative;
}

.symbol-picker-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
}

.symbol-picker-toggle::after {
  content: "▾";
  color: var(--muted);
  font-size: 12px;
  margin-left: 12px;
  flex: 0 0 auto;
}

.symbol-picker-menu {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 95;
  padding: 10px;
  border-radius: 18px;
  border: 1px solid rgba(31, 36, 48, 0.12);
  background: rgba(255, 251, 243, 0.98);
  box-shadow: 0 18px 40px rgba(78, 54, 28, 0.18);
  display: grid;
  gap: 8px;
  overflow: hidden;
}

.symbol-picker-menu[hidden] {
  display: none;
}

.symbol-option-list {
  max-height: 280px;
  overflow: auto;
  display: grid;
  gap: 6px;
}

.symbol-option {
  width: 100%;
  border: 1px solid rgba(31, 36, 48, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  padding: 10px 12px;
  text-align: left;
  font-size: 14px;
  line-height: 1.4;
}

.symbol-option:hover,
.symbol-option.selected {
  border-color: rgba(184, 92, 56, 0.22);
  background: rgba(184, 92, 56, 0.10);
  color: var(--brand);
}

.symbol-option-empty {
  border-radius: 12px;
  padding: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.6);
  border: 1px dashed rgba(31, 36, 48, 0.12);
}

.control-action {
  flex: 0 0 120px;
}

.inline-filters {
  padding: 0;
  border: none;
  box-shadow: none;
  background: transparent;
  backdrop-filter: none;
  display: grid;
  grid-template-columns:
    minmax(150px, 1.1fr)
    minmax(120px, 0.8fr)
    minmax(100px, 0.7fr)
    minmax(100px, 0.7fr)
    minmax(100px, 0.7fr)
    minmax(150px, 1fr)
    minmax(220px, 1.5fr)
    88px;
  gap: 10px;
}

.tape-page .hero {
  grid-template-columns: 1fr;
  gap: 4px;
  margin-bottom: 4px;
}

.tape-page .lede {
  margin-top: 4px;
  line-height: 1.45;
  font-size: 15px;
}

.tape-page .active-symbol-label {
  margin-top: 4px;
}

.tape-page .page-shell {
  padding-top: 14px;
  padding-bottom: 20px;
}

.tape-page .dashboard {
  gap: 10px;
}

.tape-page .panel {
  padding: 12px 14px;
  border-radius: 16px;
}

.tape-page .panel-head {
  margin-bottom: 8px;
}

.tape-page .panel-head h2 {
  font-size: 20px;
}

.tape-page .summary-cards {
  gap: 6px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.tape-page .card {
  padding: 10px 12px;
  border-radius: 12px;
}

.tape-page .card-label {
  margin-bottom: 4px;
}

.tape-page .card-value {
  font-size: 20px;
}

.tape-page table {
  font-size: 12px;
}

.tape-page th,
.tape-page td {
  padding: 8px 8px;
}

.tape-page .filter-panel {
  padding: 8px 10px;
}

.tape-page .controls label {
  font-size: 11px;
}

.tape-page select,
.tape-page input,
.tape-page button {
  padding: 8px 10px;
  font-size: 13px;
}

.tape-page h1 {
  font-size: clamp(32px, 4.8vw, 52px);
}

.tape-page .page-links {
  margin-bottom: 8px;
}

.controls label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.chart-control {
  min-width: 120px;
  display: grid;
  gap: 8px;
}

.chart-control label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

select,
input,
button {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 12px 14px;
  font-size: 15px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
}

button {
  background: linear-gradient(135deg, var(--brand), #d67f58);
  color: #fffdf8;
  border: none;
  font-weight: 600;
  cursor: pointer;
}

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

.dashboard {
  display: grid;
  gap: 18px;
}

.panel {
  border-radius: 24px;
  padding: 20px;
}

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

.panel-title-with-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.info-popover {
  position: relative;
}

.info-popover summary {
  list-style: none;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(41, 107, 115, 0.1);
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
}

.info-popover summary::-webkit-details-marker {
  display: none;
}

.info-popover-card {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 10;
  width: min(320px, 70vw);
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(31, 36, 48, 0.1);
  background: rgba(255, 251, 243, 0.98);
  box-shadow: 0 14px 30px rgba(78, 54, 28, 0.16);
}

.info-popover-card strong {
  display: block;
  margin-bottom: 8px;
}

.info-popover-card p {
  margin: 6px 0;
  color: var(--muted);
  line-height: 1.5;
}

.table-col-popover {
  display: inline-block;
  margin-left: 6px;
  vertical-align: middle;
}

.table-col-popover .info-popover-card {
  left: auto;
  right: 0;
  width: min(360px, 82vw);
}

.copilot-fab-shell {
  position: fixed;
  right: 18px;
  bottom: 16px;
  z-index: 70;
}

.copilot-side-toggle {
  position: fixed;
  right: 0;
  bottom: 148px;
  z-index: 72;
  cursor: pointer;
  pointer-events: auto;
  background: rgba(255, 251, 243, 0.98);
  color: var(--brand);
  width: 24px;
  min-width: 24px;
  height: 68px;
  border-radius: 10px 0 0 10px;
  border-right: 0;
  padding: 0;
  font-size: 20px;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(31, 36, 48, 0.22);
}

.copilot-fab-shell.is-open .copilot-side-toggle {
  bottom: 202px;
}

.copilot-fab {
  width: auto;
  min-width: 132px;
  padding: 10px 14px;
  border-radius: 999px;
  box-shadow: 0 10px 22px rgba(31, 36, 48, 0.22);
}

.copilot-fab-shell:not(.is-open) .copilot-fab {
  display: none;
}

.copilot-panel {
  margin-top: 10px;
  width: min(420px, calc(100vw - 24px));
  border-radius: 16px;
  border: 1px solid rgba(31, 36, 48, 0.12);
  background: rgba(255, 251, 243, 0.98);
  box-shadow: 0 20px 42px rgba(31, 36, 48, 0.24);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.sim-orders-drawer-shell {
  position: fixed;
  right: 0;
  top: 22vh;
  z-index: 68;
  display: flex;
  align-items: flex-start;
  pointer-events: none;
}

.sim-orders-side-toggle {
  pointer-events: auto;
  cursor: pointer;
  background: rgba(255, 251, 243, 0.98);
  color: var(--brand);
  width: 26px;
  min-width: 26px;
  height: 74px;
  border-radius: 10px 0 0 10px;
  border-right: 0;
  padding: 0;
  font-size: 20px;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(31, 36, 48, 0.2);
}

.sim-orders-drawer-panel {
  pointer-events: auto;
  width: min(540px, calc(100vw - 36px));
  max-height: 72vh;
  overflow: hidden;
  border-radius: 14px 0 0 14px;
  border: 1px solid rgba(31, 36, 48, 0.14);
  border-right: 0;
  background: rgba(255, 251, 243, 0.98);
  box-shadow: 0 16px 34px rgba(31, 36, 48, 0.22);
  padding: 10px 12px;
  display: grid;
  gap: 8px;
}

.sim-orders-drawer-shell.is-collapsed .sim-orders-drawer-panel {
  display: none;
}

.sim-orders-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sim-orders-drawer-head h3 {
  margin: 0;
  font-size: 16px;
}

.sim-drawer-head-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.sim-orders-drawer-list {
  max-height: calc(72vh - 96px);
  overflow: auto;
}

.sim-orders-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.sim-orders-table th,
.sim-orders-table td {
  border-bottom: 1px solid rgba(31, 36, 48, 0.08);
  padding: 6px 4px;
  text-align: left;
  vertical-align: top;
}

.sim-orders-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(255, 251, 243, 0.99);
}

.sim-orders-table .actions-cell {
  white-space: nowrap;
}

.sim-orders-sections {
  display: grid;
  gap: 12px;
}

.sim-orders-section-title {
  margin: 0 0 6px;
  font-size: 14px;
}

.sim-order-actions {
  min-width: 84px;
}

.sim-order-row-actions {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 0;
}

.sim-orders-drawer-panel .sim-order-actions button,
.sim-orders-drawer-panel .sim-drawer-head-actions .secondary-btn {
  width: auto;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12px;
}

.sim-close-controls {
  display: grid;
  gap: 6px;
}

.sim-close-controls label {
  display: grid;
  gap: 4px;
}

.sim-close-controls label span {
  font-size: 11px;
  color: var(--muted);
}

.sim-close-controls input,
.sim-close-controls select {
  min-width: 0;
}

.sim-close-action-row {
  display: flex;
  gap: 6px;
  align-items: end;
}

.sim-trial-panels {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.sim-trial-panel {
  border: 1px solid rgba(31, 36, 48, 0.08);
  border-radius: 10px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.56);
}

.sim-trial-panel h5 {
  margin: 0 0 4px;
  font-size: 12px;
}

.sim-trials-table-wrap {
  overflow-x: auto;
}

.sim-trials-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.sim-trials-table th,
.sim-trials-table td {
  text-align: left;
  padding: 4px;
  border-bottom: 1px solid rgba(31, 36, 48, 0.08);
}

.sim-trials-table th {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sim-order-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sim-order-controls input {
  width: 72px;
  min-width: 72px;
}

@media (max-width: 900px) {
  .sim-orders-drawer-shell {
    top: auto;
    bottom: 108px;
  }

  .sim-orders-drawer-panel {
    width: min(96vw, 520px);
    max-height: 62vh;
  }
}

@media (max-width: 640px) {
  .copilot-side-toggle,
  .copilot-fab-shell.is-open .copilot-side-toggle {
    bottom: 112px;
  }

  .positions-page .hero {
    grid-template-columns: 1fr;
  }

  .positions-inline-controls {
    width: 100%;
  }

  .positions-page .holding-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.copilot-panel-head {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.copilot-close-btn {
  width: 28px;
  height: 28px;
  min-width: 0;
  border-radius: 999px;
  padding: 0;
  line-height: 1;
  font-size: 18px;
}

.copilot-tip {
  margin: 0;
  font-size: 12px;
}

.copilot-shot-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.copilot-shot-btn {
  width: auto;
  min-width: 0;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12px;
}

.copilot-shot-preview {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px;
  align-items: start;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid rgba(31, 36, 48, 0.1);
  background: rgba(255, 255, 255, 0.72);
}

.copilot-shot-preview img {
  width: 120px;
  height: 68px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(31, 36, 48, 0.12);
}

.copilot-shot-preview p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.copilot-messages {
  max-height: min(46vh, 460px);
  overflow: auto;
  display: grid;
  gap: 8px;
  padding-right: 2px;
}

.copilot-msg {
  border-radius: 12px;
  padding: 8px 10px;
  border: 1px solid rgba(31, 36, 48, 0.1);
  line-height: 1.5;
  white-space: pre-wrap;
  font-size: 13px;
}

.copilot-msg.user {
  background: rgba(184, 92, 56, 0.10);
}

.copilot-msg.assistant {
  background: rgba(41, 107, 115, 0.08);
}

.copilot-msg.error {
  background: rgba(161, 64, 50, 0.08);
  border-color: rgba(161, 64, 50, 0.2);
}

.copilot-composer {
  display: grid;
  gap: 8px;
}

.copilot-composer textarea {
  min-height: 72px;
  resize: vertical;
}

.copilot-composer button {
  width: auto;
  justify-self: start;
}

.copilot-select-overlay {
  position: fixed;
  inset: 0;
  z-index: 91;
  background: rgba(20, 24, 33, 0.20);
  cursor: crosshair;
}

.copilot-select-bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  object-fit: fill;
  pointer-events: none;
}

.copilot-select-hint {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(20, 24, 33, 0.78);
  color: #fff;
  font-size: 12px;
}

.copilot-select-box {
  position: fixed;
  display: none;
  border: 2px dashed #d55b31;
  background: rgba(213, 91, 49, 0.10);
}

.copilot-editor {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(31, 36, 48, 0.62);
  display: grid;
  place-items: center;
  padding: 14px;
}

.copilot-editor[hidden] {
  display: none !important;
}

.copilot-editor-card {
  width: min(1080px, calc(100vw - 20px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  border-radius: 14px;
  border: 1px solid rgba(31, 36, 48, 0.12);
  background: #fffaf2;
  padding: 10px;
  display: grid;
  gap: 10px;
}

.copilot-editor-head,
.copilot-editor-tools,
.copilot-editor-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.copilot-editor-head {
  justify-content: space-between;
}

.copilot-tool {
  width: auto;
  min-width: 0;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12px;
  background: rgba(31, 36, 48, 0.08);
  color: var(--ink);
}

.copilot-tool.active {
  background: rgba(184, 92, 56, 0.16);
  color: var(--brand);
}

.copilot-tool.primary {
  background: linear-gradient(135deg, var(--brand), #d67f58);
  color: #fffdf8;
}

.copilot-editor-canvas-wrap {
  border: 1px solid rgba(31, 36, 48, 0.15);
  border-radius: 10px;
  overflow: auto;
  background: #fff;
}

#strategy-copilot-editor-canvas {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  cursor: crosshair;
}

.copilot-doodle {
  position: fixed;
  inset: 0;
  z-index: 92;
  background: rgba(31, 36, 48, 0.62);
  display: grid;
  place-items: center;
  padding: 14px;
}

.copilot-doodle[hidden] {
  display: none !important;
}

.copilot-doodle-card {
  width: min(920px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  border-radius: 14px;
  border: 1px solid rgba(31, 36, 48, 0.14);
  background: #fffaf2;
  padding: 10px;
  display: grid;
  gap: 10px;
}

.copilot-doodle-head,
.copilot-doodle-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.copilot-doodle-canvas-wrap {
  border: 1px solid rgba(31, 36, 48, 0.14);
  border-radius: 10px;
  overflow: auto;
  background: #fff;
}

#strategy-copilot-doodle-canvas {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  cursor: crosshair;
}

.strategy-intro-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.event-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.card {
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.55));
  border: 1px solid rgba(31, 36, 48, 0.08);
}

.card-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 6px;
}

.card-value {
  font-size: 28px;
  font-weight: 700;
}

.chart-wrap {
  min-height: 320px;
  position: relative;
}

.chart-canvas {
  width: 100%;
  height: 320px;
  display: block;
}

.chart-empty,
.table-empty {
  padding: 30px 10px;
  text-align: center;
  color: var(--muted);
}

.table-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.table-pagination-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.table-pagination button {
  min-height: 30px;
  padding: 5px 10px;
}

.table-pagination button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.policy-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 14px;
}

.policy-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(41, 107, 115, 0.08);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.policy-chip.good {
  background: rgba(47, 107, 72, 0.12);
  color: var(--good);
}

.policy-chip.warn {
  background: rgba(184, 92, 56, 0.12);
  color: var(--brand);
}

.policy-chip.bad {
  background: rgba(161, 64, 50, 0.12);
  color: var(--bad);
}

.earnings-alert {
  margin-top: 14px;
}

.earnings-alert-card {
  border-radius: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(31, 36, 48, 0.1);
  background: rgba(255, 255, 255, 0.62);
}

.earnings-alert-card.crossing {
  background: rgba(161, 64, 50, 0.08);
  border-color: rgba(161, 64, 50, 0.18);
}

.earnings-alert-card.near {
  background: rgba(184, 92, 56, 0.08);
  border-color: rgba(184, 92, 56, 0.18);
}

.earnings-alert-card.neutral {
  background: rgba(41, 107, 115, 0.08);
  border-color: rgba(41, 107, 115, 0.16);
}

.earnings-alert-title {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.earnings-next-event {
  font-size: 14px;
  line-height: 1.45;
  margin-bottom: 6px;
}

.earnings-alert-emphasis {
  color: var(--bad);
  font-weight: 700;
}

.earnings-alert-body {
  font-size: 15px;
  line-height: 1.55;
}

.contract-link,
.quote-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.contract-link:hover,
.quote-link:hover {
  color: var(--brand);
  text-decoration: underline;
}

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

.position-group {
  border: 1px solid rgba(31, 36, 48, 0.1);
  background: rgba(255, 255, 255, 0.55);
  border-radius: 18px;
  padding: 16px;
}

.position-group.direct {
  box-shadow: inset 0 0 0 1px rgba(41, 107, 115, 0.08);
}

.position-group.related {
  box-shadow: inset 0 0 0 1px rgba(184, 92, 56, 0.08);
}

.position-group-head {
  margin-bottom: 12px;
}

.position-list {
  display: grid;
  gap: 12px;
}

.holding-card {
  border: 1px solid rgba(31, 36, 48, 0.08);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255, 251, 243, 0.72);
}

.holding-card.direct {
  background: linear-gradient(180deg, rgba(241, 249, 247, 0.92), rgba(255, 255, 255, 0.78));
}

.holding-card.related {
  background: linear-gradient(180deg, rgba(255, 247, 241, 0.92), rgba(255, 255, 255, 0.78));
}

.holding-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.holding-card-title {
  font-size: 18px;
  font-weight: 700;
}

.holding-card-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.holding-card-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.holding-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.holding-metric {
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(31, 36, 48, 0.06);
}

.holding-metric-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 6px;
}

.holding-metric-value {
  font-size: 16px;
  font-weight: 700;
}

.holding-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 14px;
}

.group-mini-table-wrap {
  margin-top: 12px;
  overflow-x: auto;
}

.group-mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.58);
  border-radius: 12px;
  overflow: hidden;
}

.group-mini-table th,
.group-mini-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(31, 36, 48, 0.08);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.group-mini-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  background: rgba(31, 36, 48, 0.04);
}

.group-mini-table tr:last-child td {
  border-bottom: none;
}

.positions-page .group-mini-table tbody tr[title] {
  cursor: help;
}

.positions-page .margin-timeline-table {
  table-layout: fixed;
  min-width: 860px;
}

.positions-page .margin-timeline-table th,
.positions-page .margin-timeline-table td {
  padding: 8px 10px;
}

.positions-page .margin-timeline-table th.resizable-th {
  position: relative;
}

.positions-page .margin-timeline-table th .col-resize-handle {
  position: absolute;
  top: 0;
  right: -4px;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  user-select: none;
  touch-action: none;
}

.positions-page .margin-timeline-table th .col-resize-handle::after {
  content: "";
  position: absolute;
  top: 18%;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 64%;
  background: rgba(31, 36, 48, 0.18);
  border-radius: 2px;
}

body.is-resizing-col {
  cursor: col-resize !important;
  user-select: none !important;
}

.positions-page .margin-timeline-table td {
  white-space: normal;
}

.positions-page .margin-timeline-table tr.margin-risk-row td {
  background: rgba(161, 64, 50, 0.06);
}

.positions-page .margin-timeline-table tr.margin-risk-row td:first-child {
  border-left: 3px solid rgba(161, 64, 50, 0.72);
}

.positions-page .margin-timeline-table th:nth-child(1),
.positions-page .margin-timeline-table td:nth-child(1) {
  width: 112px;
  padding-left: 6px;
  padding-right: 6px;
}

.positions-page .margin-timeline-table th:nth-child(2),
.positions-page .margin-timeline-table td:nth-child(2) {
  min-width: 110px;
}

.positions-page .margin-timeline-table th:nth-child(6),
.positions-page .margin-timeline-table td:nth-child(6) {
  min-width: 126px;
}

.positions-page .margin-timeline-table th:nth-child(8),
.positions-page .margin-timeline-table td:nth-child(8) {
  width: 86px;
  text-align: center;
}

.timeline-duo-top,
.timeline-duo-bottom {
  display: block;
  line-height: 1.3;
}

.positions-page .margin-timeline-table td:nth-child(1) .timeline-duo-top,
.positions-page .margin-timeline-table td:nth-child(1) .timeline-duo-bottom {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.positions-page .margin-timeline-table td:nth-child(1) .timeline-duo-top {
  max-width: 84px;
}

.timeline-single-line {
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timeline-duo-bottom {
  margin-top: 3px;
  color: var(--accent);
  font-size: 12px;
}

.margin-timeline-compact-summary {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px 8px;
  margin-top: 8px;
  border-top: 2px solid rgba(31, 36, 48, 0.18);
  padding: 7px 10px;
  background: rgba(36, 91, 99, 0.04);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.35;
  overflow-x: auto;
  scrollbar-width: thin;
}

.margin-timeline-overall-summary {
  margin-bottom: 6px;
}

.margin-timeline-overall-summary .margin-timeline-compact-summary {
  margin-top: 0;
  border: 1px solid rgba(36, 91, 99, 0.18);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  background: rgba(36, 91, 99, 0.06);
}

.margin-timeline-compact-summary-label {
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.margin-timeline-compact-summary-currency {
  display: inline-flex;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  align-items: center;
  gap: 3px 6px;
  min-width: 0;
}

.margin-timeline-compact-summary-currency + .margin-timeline-compact-summary-currency {
  border-left: 1px solid rgba(31, 36, 48, 0.16);
  padding-left: 8px;
}

.margin-timeline-compact-summary-currency > strong {
  color: var(--brand);
}

.margin-timeline-summary-margin {
  color: var(--brand);
  font-weight: 800;
}

.margin-timeline-summary-metric {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  color: var(--ink);
}

.margin-timeline-summary-profit {
  color: var(--ink);
  font-weight: 400;
}

.margin-timeline-summary-metric + .margin-timeline-summary-metric .margin-timeline-summary-profit {
  font-weight: 800;
}

.margin-timeline-compact-summary-currency span {
  white-space: nowrap;
}

.quote-spread-compact {
  display: inline;
  margin-left: 5px;
  padding: 0;
  color: inherit;
  background: transparent;
  font-size: 11px;
  font-weight: 800;
  line-height: inherit;
  letter-spacing: 0;
  white-space: nowrap;
}

.margin-risk-note {
  color: var(--bad);
  font-weight: 700;
}

.timeline-ladder-link,
.timeline-trade-link {
  color: var(--brand);
  text-decoration: none;
}

.timeline-ladder-link:hover,
.timeline-trade-link:hover {
  text-decoration: underline;
}

.timeline-trade-link {
  font-size: 12px;
}

.protective-put-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  margin-top: 0;
  padding: 4px 8px;
  border: 1px solid rgba(36, 91, 99, 0.35);
  border-radius: 6px;
  background: rgba(36, 91, 99, 0.08);
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.protective-put-button:hover,
.protective-put-trade-link:hover {
  text-decoration: underline;
}

.protective-put-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.45);
}

.protective-put-modal.open {
  display: flex;
}

.protective-put-dialog {
  width: min(980px, 100%);
  max-height: min(760px, 92vh);
  overflow: hidden;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.25);
}

.protective-put-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding: 14px 16px;
}

.protective-put-head h2 {
  margin: 0;
  font-size: 18px;
}

.protective-put-close {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 6px;
}

.protective-put-modal-body {
  max-height: calc(92vh - 72px);
  overflow: auto;
  padding: 16px;
}

.protective-put-summary {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.protective-put-summary-main {
  display: grid;
  flex: 1 1 520px;
  gap: 4px;
  min-width: 0;
}

.protective-put-price-basis-control {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.protective-put-price-basis-control select {
  min-width: 126px;
  min-height: 32px;
}

.protective-put-table {
  min-width: 860px;
}

.protective-put-trade-link {
  color: var(--brand);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.group-action-cell {
  min-width: 132px;
}

.group-action-cell.action-bad {
  background: rgba(161, 64, 50, 0.08);
}

.group-action-cell.action-warn {
  background: rgba(184, 92, 56, 0.08);
}

.group-action-cell.action-good {
  background: rgba(47, 107, 72, 0.08);
}

.option-expiry-group-row td {
  background: rgba(36, 91, 99, 0.08);
  color: var(--ink);
  font-weight: 780;
  letter-spacing: 0;
}

.error-message {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(161, 64, 50, 0.18);
  background: rgba(161, 64, 50, 0.08);
  color: var(--bad);
  line-height: 1.5;
}

.positions-page .summary-cards {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.positions-page .hero {
  gap: 0;
}

.monthly-pnl-shell {
  max-width: 1440px;
}

.monthly-option-pnl-page .monthly-pnl-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.monthly-pnl-heading h1 {
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: 0;
}

.monthly-pnl-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(36, 91, 99, 0.22);
  border-left: 4px solid var(--account-accent);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(32, 40, 43, 0.08);
}

.monthly-pnl-toolbar label {
  display: grid;
  gap: 5px;
  color: var(--account-accent);
  font-size: 13px;
  font-weight: 800;
}

.monthly-pnl-toolbar select,
.monthly-pnl-toolbar button {
  min-height: 46px;
  border-radius: 6px;
  letter-spacing: 0;
}

.monthly-pnl-toolbar select {
  min-height: 46px;
  min-width: 190px;
  border: 2px solid var(--account-accent);
  padding: 0 36px 0 12px;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
}

.monthly-pnl-toolbar select:focus {
  outline: 3px solid rgba(36, 91, 99, 0.18);
  outline-offset: 2px;
}

.monthly-pnl-toolbar button {
  padding: 0 16px;
  background: var(--account-accent);
  white-space: nowrap;
}

.monthly-pnl-dashboard {
  display: grid;
  gap: 18px;
}

.monthly-pnl-workspace {
  min-width: 0;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.monthly-option-pnl-page .card {
  border-radius: 8px;
  background: #fff;
}

.positions-inline-controls {
  display: flex;
  gap: 10px;
  align-items: end;
}

@media (max-width: 700px) {
  .monthly-option-pnl-page .monthly-pnl-header {
    flex-direction: column;
    align-items: stretch;
  }

  .monthly-option-pnl-page .monthly-pnl-heading {
    padding-top: 92px;
  }

  .monthly-pnl-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    width: 100%;
  }

  .monthly-pnl-toolbar label {
    min-width: 0;
  }

  .monthly-pnl-toolbar select {
    width: 100%;
    min-width: 0;
  }
}

.month-select-field {
  min-width: 150px;
}

.positions-helper-text {
  margin: 12px 0 10px;
  line-height: 1.5;
}

.positions-loading-block {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 14px 16px;
  border: 1px solid rgba(31, 36, 48, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.64);
  color: var(--ink);
}

.positions-loading-spinner {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border-radius: 999px;
  border: 2px solid rgba(31, 36, 48, 0.14);
  border-top-color: var(--accent);
  animation: positions-loading-spin 820ms linear infinite;
}

.positions-loading-title {
  font-weight: 700;
  font-size: 13px;
}

.positions-loading-detail {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.positions-status-loading {
  color: var(--accent);
  font-weight: 700;
}

@keyframes positions-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

.positions-panel-fold {
  display: grid;
  gap: 0;
}

.positions-panel-summary {
  list-style: none;
  cursor: pointer;
  user-select: text;
  margin-bottom: 0;
}

.positions-panel-summary::-webkit-details-marker {
  display: none;
}

.positions-panel-summary > div {
  min-width: 0;
}

.account-overview-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.account-overview-title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
}

.account-overview-fetch-time {
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 500;
}

.positions-panel-chevron {
  width: 12px;
  height: 12px;
  margin-top: 8px;
  flex: 0 0 auto;
  border-right: 2px solid rgba(31, 36, 48, 0.55);
  border-bottom: 2px solid rgba(31, 36, 48, 0.55);
  transform: rotate(45deg);
  transition: transform 140ms ease;
}

.positions-panel-fold[open] .positions-panel-chevron,
.monthly-detail-fold[open] .positions-panel-chevron {
  transform: rotate(225deg);
}

.positions-panel-body {
  padding-top: 14px;
  transition: opacity 160ms ease;
}

.positions-panel-body.is-loading {
  opacity: 0.78;
}

.monthly-option-section + .monthly-option-section {
  margin-top: 18px;
}

.monthly-option-section .panel-head {
  margin-bottom: 12px;
}

.monthly-option-section h3 {
  margin: 0;
  font-size: 18px;
}

.monthly-currency-group + .monthly-currency-group {
  margin-top: 16px;
}

.monthly-currency-group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.monthly-currency-group-metrics {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.monthly-detail-fold {
  display: grid;
  gap: 0;
}

.monthly-detail-summary {
  list-style: none;
  cursor: pointer;
  user-select: text;
  margin-bottom: 0;
}

.monthly-detail-summary::-webkit-details-marker {
  display: none;
}

.monthly-detail-summary > div {
  min-width: 0;
}

.monthly-detail-body {
  padding-top: 14px;
}

.monthly-detail-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
}

.monthly-detail-controls label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.monthly-detail-controls select {
  min-height: 28px;
  border-radius: 6px;
  border: 1px solid rgba(31, 36, 48, 0.16);
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.monthly-detail-column-picker {
  position: relative;
}

.monthly-detail-column-picker summary {
  cursor: pointer;
  color: var(--brand);
  font-weight: 760;
}

.monthly-detail-column-options {
  position: absolute;
  z-index: 20;
  right: 0;
  top: calc(100% + 6px);
  display: grid;
  gap: 6px;
  min-width: 180px;
  padding: 10px;
  border: 1px solid rgba(31, 36, 48, 0.14);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(31, 36, 48, 0.12);
}

.monthly-detail-column-options label {
  justify-content: flex-start;
  color: var(--ink);
  white-space: nowrap;
}

.monthly-detail-time-cell {
  width: 1%;
  min-width: 86px;
  white-space: nowrap;
  vertical-align: top;
}

.monthly-detail-date,
.monthly-detail-clock {
  display: block;
  line-height: 1.15;
}

.monthly-detail-clock {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.margin-timeline-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
}

.margin-day-card {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(31, 36, 48, 0.08);
  background: rgba(255, 255, 255, 0.82);
}

.margin-timeline-panel-summary {
  display: flex;
  align-items: center;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
}

.margin-timeline-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
}

.margin-timeline-actions label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.margin-timeline-actions select {
  width: auto;
  min-width: 112px;
  min-height: 32px;
  padding: 5px 28px 5px 9px;
}

.margin-timeline-group > summary {
  cursor: pointer;
  list-style: none;
}

.margin-timeline-group > summary::-webkit-details-marker {
  display: none;
}

.margin-timeline-group[open] > .margin-day-head {
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.margin-timeline-group .group-mini-table-wrap {
  margin-top: 0;
}

.margin-day-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 0;
  user-select: text;
}

.positions-page .margin-day-head {
  flex-direction: row;
  align-items: center;
}

.margin-day-heading {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 3px 8px;
  min-width: 0;
}

.margin-day-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent);
}

.margin-day-totals {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.margin-day-totals .margin-timeline-compact-summary {
  flex: 1 1 auto;
  min-width: 0;
  margin-top: 0;
  border-top: 0;
  padding: 0;
  background: transparent;
}

.margin-day-chevron {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  margin: 0 4px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 160ms ease;
}

.margin-timeline-group[open] .margin-day-chevron {
  transform: rotate(225deg);
}

@media (max-width: 760px) {
  .positions-page .margin-day-head {
    flex-direction: column;
    align-items: stretch;
  }

  .positions-page .margin-day-totals {
    justify-content: flex-start;
    width: 100%;
  }
}

.positions-page .card-value {
  font-size: 24px;
}

.positions-page .holding-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.pl-positive {
  color: var(--good);
}

.pl-negative {
  color: var(--bad);
}

.option-detail-page .hero {
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

.option-detail-page .summary-cards {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.option-detail-page .panel-head {
  align-items: end;
}

.muted-chip {
  background: rgba(31, 36, 48, 0.06);
  color: var(--muted);
}

svg {
  width: 100%;
  height: auto;
  display: block;
}

.axis-label {
  fill: var(--muted);
  font-size: 12px;
}

.axis-line,
.grid-line {
  stroke: rgba(31, 36, 48, 0.14);
  stroke-width: 1;
}

.series-price {
  stroke: var(--brand);
  fill: none;
  stroke-width: 3;
}

.series-contracts {
  stroke: var(--accent);
  fill: none;
  stroke-width: 2.5;
}

.series-call {
  stroke: var(--brand);
  fill: none;
  stroke-width: 3;
}

.series-put {
  stroke: var(--accent);
  fill: none;
  stroke-width: 3;
}

.series-underlying {
  stroke: #6c4f90;
  fill: none;
  stroke-width: 3;
}

.point-label {
  fill: var(--ink);
  font-size: 11px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(31, 36, 48, 0.08);
  text-align: right;
}

th:first-child,
td:first-child {
  text-align: left;
}

th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.sort-button {
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}

.sort-button.active {
  color: var(--brand);
}

.table-stack {
  display: grid;
  gap: 10px;
}

.table-actions {
  display: flex;
  justify-content: flex-end;
}

.toggle-button {
  border: 1px solid rgba(31, 36, 48, 0.12);
  background: rgba(255, 255, 255, 0.72);
  color: var(--accent);
  border-radius: 999px;
  padding: 7px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.toggle-button:hover {
  color: var(--brand);
  border-color: rgba(184, 92, 56, 0.22);
}

.reference-row td {
  background: linear-gradient(90deg, rgba(41, 107, 115, 0.08), rgba(41, 107, 115, 0.02));
  color: var(--accent);
  font-weight: 700;
  border-bottom: 1px solid rgba(41, 107, 115, 0.12);
}

.quote-up {
  color: var(--bad);
  font-weight: 700;
}

.quote-down {
  color: var(--good);
  font-weight: 700;
}

.position-hit-row td {
  background: rgba(41, 107, 115, 0.05);
}

.position-hit-row td:first-child {
  box-shadow: inset 3px 0 0 rgba(41, 107, 115, 0.32);
}

.tactical-risk-row td {
  background: rgba(161, 64, 50, 0.06);
}

.tactical-risk-row td:first-child {
  box-shadow: inset 3px 0 0 rgba(161, 64, 50, 0.34);
}

.tactical-comfort-row td {
  background: rgba(47, 107, 72, 0.06);
}

.tactical-comfort-row td:first-child {
  box-shadow: inset 3px 0 0 rgba(47, 107, 72, 0.34);
}

.near-spot-strike-cell {
  background: linear-gradient(90deg, rgba(184, 92, 56, 0.2), rgba(184, 92, 56, 0.08)) !important;
  box-shadow: inset 3px 0 0 rgba(184, 92, 56, 0.62);
}

.near-spot-strike-link {
  color: #9a3f20;
  font-weight: 800;
}

@keyframes ladder-url-focus-pulse {
  0% {
    box-shadow: inset 0 0 0 2px rgba(184, 92, 56, 0.68);
    background-color: rgba(184, 92, 56, 0.24);
  }
  30% {
    box-shadow: inset 0 0 0 2px rgba(184, 92, 56, 0.58);
    background-color: rgba(184, 92, 56, 0.2);
  }
  60% {
    box-shadow: inset 0 0 0 2px rgba(184, 92, 56, 0.4);
    background-color: rgba(184, 92, 56, 0.12);
  }
  100% {
    box-shadow: inset 0 0 0 2px rgba(184, 92, 56, 0.12);
    background-color: transparent;
  }
}

.sell-put-ladder-page #ladder-table tr.url-focus-hit td {
  animation: ladder-url-focus-pulse 6s ease-out;
}

.buffer-atr-cell-risk {
  color: var(--bad);
  font-weight: 700;
}

.buffer-atr-cell-comfort {
  color: var(--good);
  font-weight: 700;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.pill.good {
  background: rgba(47, 107, 72, 0.12);
  color: var(--good);
}

.pill.bad {
  background: rgba(161, 64, 50, 0.12);
  color: var(--bad);
}

.pill.warn {
  background: rgba(184, 92, 56, 0.12);
  color: var(--brand);
}

.pill.call {
  background: rgba(184, 92, 56, 0.12);
  color: var(--brand);
}

.pill.put {
  background: rgba(41, 107, 115, 0.12);
  color: var(--accent);
}

.quote-cell {
  display: inline-block;
  min-width: 86px;
  padding: 6px 8px;
  border-radius: 10px;
}

.position-inline-chip {
  margin-right: 8px;
}

.row-position-note {
  display: block;
  margin-top: 6px;
  color: var(--accent);
  font-size: 12px;
  line-height: 1.45;
}


.mobile-ladder {
  display: grid;
  gap: 10px;
}

.ladder-card {
  border: 1px solid rgba(31, 36, 48, 0.1);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.6);
}

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

.ladder-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.ask-cell {
  background: rgba(161, 64, 50, 0.08);
}

.bid-cell {
  background: rgba(47, 107, 72, 0.08);
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .home-quick-trade-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .home-quick-trade-form button {
    grid-column: 1 / -1;
  }

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

  .panel-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-shell {
    padding: 20px 14px 32px;
  }

  .tape-controls {
    display: grid;
  }

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

  .control-action {
    flex: 1 1 auto;
  }

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

  .tape-page .summary-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .position-group-grid {
    grid-template-columns: 1fr;
  }

  .table-panel-controls {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .page-shell {
    padding: 12px 8px 18px;
  }

  .page-links {
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
  }

  .panel {
    padding: 10px;
    border-radius: 12px;
  }

  .panel-head {
    margin-bottom: 10px;
    gap: 8px;
  }

  h1 {
    font-size: clamp(28px, 10vw, 40px);
    line-height: 1.04;
  }

  h2 {
    font-size: 20px;
  }

  .lede {
    font-size: 13px;
    line-height: 1.4;
  }

  .controls,
  .filter-panel {
    padding: 10px;
    border-radius: 12px;
  }

  .home-shell {
    min-height: auto;
    justify-content: flex-start;
  }

  .home-quick-trade-form {
    grid-template-columns: 1fr;
  }

  .home-tool-grid {
    grid-template-columns: 1fr;
  }

  .home-tool-link {
    min-height: 82px;
  }

  .control-field {
    min-width: 0;
    flex: 1 1 100%;
  }

  .quick-filters,
  .inline-filters {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .table-panel-controls {
    grid-template-columns: 1fr;
    width: 100%;
  }

  select,
  input,
  button {
    font-size: 16px;
    padding: 10px 12px;
    border-radius: 10px;
  }

  .card {
    padding: 10px;
    border-radius: 10px;
  }

  .card-value {
    font-size: 20px;
  }

  [id$="-table"],
  .table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  [id$="-table"] table,
  .table-scroll table {
    min-width: 560px;
  }

  .positions-page .margin-timeline-table th .col-resize-handle {
    display: none;
  }
}

@media (max-width: 480px) {
  th,
  td {
    padding: 7px 6px;
  }

  table {
    font-size: 12px;
  }

  [id$="-table"] table,
  .table-scroll table {
    min-width: 500px;
  }

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


  .tape-page .summary-cards {
    grid-template-columns: 1fr;
  }

  .holding-card-head {
    flex-direction: column;
  }

  .holding-card-pills {
    justify-content: flex-start;
  }

  .holding-metrics {
    grid-template-columns: 1fr;
  }
}

.playbook-page .page-shell {
  max-width: 1340px;
}

.playbook-hero {
  align-items: start;
}

.playbook-nav {
  padding: 18px;
  border-radius: 22px;
  display: grid;
  gap: 10px;
}

.playbook-nav h2 {
  font-size: 22px;
}

.playbook-nav a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.playbook-dashboard {
  gap: 18px;
}

.playbook-panel {
  padding: 22px;
  border-radius: 24px;
}

.playbook-grid {
  display: grid;
  gap: 16px;
}

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

.playbook-grid.four-up {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.playbook-grid.three-up {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sell-put-analysis-page .hero {
  grid-template-columns: 1fr;
  align-items: start;
  gap: 14px;
}

.analysis-selector-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.table-panel-controls {
  display: grid;
  grid-template-columns: minmax(130px, 150px) minmax(120px, 140px) minmax(140px, 170px) minmax(140px, 170px) minmax(110px, 130px) minmax(96px, 112px);
  gap: 10px;
  align-items: end;
}

.table-expiry-control {
  min-width: 0;
}

.table-basis-control {
  min-width: 140px;
}

.table-columns-control {
  min-width: 140px;
}

.table-auto-refresh-control,
.table-refresh-button-control {
  min-width: 0;
}

.table-refresh-button-control {
  align-self: start;
}

.recommendation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.support-system-grid,
.support-check-grid {
  margin-top: 16px;
}

.recommendation-card {
  border: 1px solid rgba(31, 36, 48, 0.1);
  background: rgba(255, 255, 255, 0.62);
  border-radius: 18px;
  padding: 18px;
}

.recommendation-card h3 {
  margin: 10px 0 10px;
  font-size: 30px;
}

.recommendation-card p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.6;
}

.recommendation-tone {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.recommendation-card.safe .recommendation-tone {
  background: rgba(47, 107, 72, 0.12);
  color: var(--good);
}

.recommendation-card.balanced .recommendation-tone {
  background: rgba(184, 92, 56, 0.12);
  color: var(--brand);
}

.recommendation-card.aggressive .recommendation-tone {
  background: rgba(161, 64, 50, 0.12);
  color: var(--bad);
}

.recommendation-card.safe {
  box-shadow: inset 0 0 0 1px rgba(47, 107, 72, 0.08);
}

.recommendation-card.balanced {
  box-shadow: inset 0 0 0 1px rgba(184, 92, 56, 0.08);
}

.recommendation-card.aggressive {
  box-shadow: inset 0 0 0 1px rgba(161, 64, 50, 0.08);
}

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

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric-pill,
.check-card,
.note-board {
  border: 1px solid rgba(31, 36, 48, 0.1);
  background: rgba(255, 255, 255, 0.6);
  border-radius: 18px;
  padding: 16px;
}

.metric-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric-pill strong {
  font-size: 26px;
  line-height: 1.1;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
}

.emphasis-bad {
  background: rgba(161, 64, 50, 0.08);
  border-color: rgba(161, 64, 50, 0.2);
}

.emphasis-warn {
  background: rgba(184, 92, 56, 0.08);
  border-color: rgba(184, 92, 56, 0.2);
}

.note-board h3,
.check-card h3 {
  margin: 0 0 12px;
  font-size: 20px;
}

.note-board p,
.check-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.signal-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  color: var(--ink);
  line-height: 1.55;
}

.signal-list.good-list li::marker {
  color: var(--good);
}

.signal-list.bad-list li::marker {
  color: var(--bad);
}

.callout-band {
  margin-top: 16px;
  border-radius: 20px;
  padding: 18px 20px;
  background:
    linear-gradient(135deg, rgba(184, 92, 56, 0.12), rgba(41, 107, 115, 0.12)),
    rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(31, 36, 48, 0.08);
}

.callout-band p {
  margin: 6px 0 0;
  font-size: 18px;
  line-height: 1.65;
}

.checklist-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.docs-index-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.docs-index-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(31, 36, 48, 0.1);
  background: rgba(255, 255, 255, 0.6);
}

.docs-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.docs-link:hover {
  color: var(--brand);
  text-decoration: underline;
}

.docs-meta {
  white-space: nowrap;
}

@media (max-width: 1120px) {
  .metric-strip,
  .checklist-grid,
  .playbook-grid.four-up,
  .analysis-selector-grid,
  .recommendation-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .strategy-intro-grid,
  .playbook-grid.two-up,
  .playbook-grid.three-up,
  .playbook-grid.four-up,
  .metric-strip,
  .checklist-grid,
  .analysis-selector-grid,
  .recommendation-grid {
    grid-template-columns: 1fr;
  }

  .playbook-panel {
    padding: 18px;
    border-radius: 20px;
  }

  .metric-pill strong {
    font-size: 22px;
  }

  .callout-band p {
    font-size: 16px;
  }
}

/* Risk Reversal Page */
.risk-reversal-page .summary-value.regime-badge {
  background: var(--brand-soft);
  color: var(--brand);
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 13px;
}

.style-tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.style-conservative {
  background: rgba(47, 107, 72, 0.15);
  color: var(--good);
}

.style-balanced {
  background: rgba(41, 107, 115, 0.15);
  color: var(--accent);
}

.style-aggressive {
  background: rgba(161, 64, 50, 0.15);
  color: var(--bad);
}

.analysis-selector-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.sell-put-analysis-page .analysis-selector-grid {
  grid-template-columns: repeat(7, minmax(132px, 1fr));
}

.sell-put-analysis-page .controls {
  justify-self: stretch;
  width: 100%;
  max-width: 100%;
}

.sell-put-analysis-page .controls > .analysis-selector-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(132px, 1fr));
  gap: 12px;
  align-items: end;
  overflow: visible;
  padding-bottom: 0;
}

.sell-put-analysis-page .controls > .analysis-selector-grid .control-field {
  min-width: 0;
}

.sell-put-analysis-page .primary-symbol-field {
  min-width: 260px;
  grid-column: span 2;
}

.sell-put-analysis-page .position-switch-field {
  min-width: 260px;
  grid-column: span 2;
}

.sell-put-analysis-page #refresh-btn,
.sell-put-analysis-page #expiry-refresh-btn,
.sell-put-analysis-page #manual-refresh-btn,
.sell-put-analysis-page #table-refresh-btn {
  width: auto;
  min-width: 112px;
  justify-self: start;
}

@media (max-width: 1024px) {
  .sell-put-analysis-page .controls > .analysis-selector-grid {
    grid-template-columns: repeat(3, minmax(210px, 1fr));
  }

  .sell-put-analysis-page .controls > .analysis-selector-grid .control-field,
  .sell-put-analysis-page .primary-symbol-field,
  .sell-put-analysis-page .position-switch-field {
    min-width: 0;
  }

  .sell-put-analysis-page .primary-symbol-field,
  .sell-put-analysis-page .position-switch-field {
    grid-column: span 1;
  }

  .compare-filter-grid {
    grid-template-columns: 1fr;
  }

  .margin-day-head {
    flex-direction: column;
    align-items: stretch;
  }

  .margin-day-totals {
    justify-content: flex-start;
    width: 100%;
  }

  .margin-timeline-toolbar {
    justify-content: stretch;
  }

  .margin-timeline-toolbar select {
    flex: 1 1 auto;
    min-width: 0;
  }
}

@media (max-width: 760px) {
  .sell-put-analysis-page .controls > .analysis-selector-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .sell-put-analysis-page .controls > .analysis-selector-grid .control-field,
  .sell-put-analysis-page .primary-symbol-field,
  .sell-put-analysis-page .position-switch-field {
    min-width: 0;
  }
}

.iron-condor-lab-page .controls {
  width: 100%;
  justify-self: stretch;
}

.sell-put-ladder-page .symbol-picker-toggle {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(31, 36, 48, 0.14);
  box-shadow: none;
}

.sell-put-ladder-page .symbol-picker-menu {
  padding: 8px;
  border-radius: 12px;
  border-color: rgba(31, 36, 48, 0.10);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 8px 20px rgba(31, 36, 48, 0.08);
}

.sell-put-ladder-page .symbol-option-list {
  gap: 4px;
}

.sell-put-ladder-page .symbol-option {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(31, 36, 48, 0.06);
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.3;
}

.sell-put-ladder-page .symbol-option:hover,
.sell-put-ladder-page .symbol-option.selected {
  border-color: rgba(31, 36, 48, 0.12);
  background: rgba(31, 36, 48, 0.05);
  color: var(--ink);
}

.sell-put-ladder-page .symbol-option-empty {
  border-radius: 8px;
  padding: 10px;
  background: rgba(31, 36, 48, 0.03);
}

.sell-put-ladder-page .event-alert-banner {
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(176, 30, 30, 0.35);
  background: rgba(214, 40, 40, 0.12);
  color: #8f1f1f;
  font-weight: 700;
  line-height: 1.35;
}

.sell-put-ladder-page .event-alert-banner.is-empty {
  border-style: dashed;
  border-color: rgba(31, 36, 48, 0.2);
  background: rgba(31, 36, 48, 0.06);
  color: var(--muted);
  font-weight: 600;
}

.iron-condor-lab-page .symbol-picker-toggle {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(31, 36, 48, 0.14);
  box-shadow: none;
}

.iron-condor-lab-page .symbol-picker-menu {
  padding: 8px;
  border-radius: 12px;
  border-color: rgba(31, 36, 48, 0.10);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 8px 20px rgba(31, 36, 48, 0.08);
}

.iron-condor-lab-page .symbol-option-list {
  gap: 4px;
}

.iron-condor-lab-page .symbol-option {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(31, 36, 48, 0.06);
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.3;
}

.iron-condor-lab-page .symbol-option:hover,
.iron-condor-lab-page .symbol-option.selected {
  border-color: rgba(31, 36, 48, 0.12);
  background: rgba(31, 36, 48, 0.05);
  color: var(--ink);
}

.iron-condor-lab-page .symbol-option-empty {
  border-radius: 8px;
  padding: 10px;
  background: rgba(31, 36, 48, 0.03);
}

.iron-condor-lab-page .event-alert-banner {
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(176, 30, 30, 0.35);
  background: rgba(214, 40, 40, 0.12);
  color: #8f1f1f;
  font-weight: 700;
  line-height: 1.35;
}

.iron-condor-lab-page .event-alert-banner.is-empty {
  border-style: dashed;
  border-color: rgba(31, 36, 48, 0.2);
  background: rgba(31, 36, 48, 0.06);
  color: var(--muted);
  font-weight: 600;
}

.iron-condor-lab-page .controls > .analysis-selector-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 10px;
  align-items: end;
  overflow: visible;
  padding-bottom: 0;
}

.iron-condor-lab-page .controls > .analysis-selector-grid .control-field {
  min-width: 0;
  flex: none;
}

@media (max-width: 1280px) {
  .iron-condor-lab-page .controls > .analysis-selector-grid {
    grid-template-columns: repeat(4, minmax(140px, 1fr));
  }
}

@media (max-width: 980px) {
  .iron-condor-lab-page .controls > .analysis-selector-grid {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }
}

@media (max-width: 760px) {
  .iron-condor-lab-page .controls > .analysis-selector-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Table good/bad cells */
.data-table td.good {
  color: var(--good);
  font-weight: 600;
}

.data-table td.bad {
  color: var(--bad);
  font-weight: 600;
}

.calendar-arb-page .page-shell {
  max-width: 1560px;
}

.calendar-arb-page .hero {
  grid-template-columns: 1fr;
  align-items: start;
  gap: 14px;
}

.calendar-arb-page .lede {
  max-width: none;
}

.calendar-arb-page .controls {
  padding: 16px;
  border-radius: 18px;
}

.calendar-preset-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.calendar-preset-btn {
  min-width: 72px;
}

.calendar-preset-btn.is-active {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: rgba(184, 92, 56, 0.2);
}

.calendar-filter-strip {
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 4px;
}

.calendar-filter-inline {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  align-items: end;
}

.calendar-arb-page .calendar-filter-inline .control-field {
  flex: 0 0 168px;
  min-width: 168px;
}

.calendar-arb-page .calendar-filter-inline .control-field:last-child {
  flex-basis: 180px;
  min-width: 180px;
}

.option-fee-page .hero {
  grid-template-columns: 1fr;
  align-items: start;
}

.option-fee-page .controls {
  padding: 16px;
  border-radius: 18px;
}

.option-fee-filter-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  align-items: end;
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 4px;
}

.option-fee-filter-grid .control-field {
  flex: 0 0 148px;
  min-width: 148px;
}

.option-fee-filter-grid .control-field:last-child {
  flex-basis: 128px;
  min-width: 128px;
}

.option-fee-page #refresh-btn {
  width: auto;
  min-width: 92px;
}

.account-access-log-page .hero {
  grid-template-columns: 1fr;
  align-items: start;
}

.account-access-log-page .controls {
  padding: 16px;
  border-radius: 8px;
}

.account-access-log-page .account-access-account-controls {
  flex: 1 1 100%;
  min-width: 0;
}

.account-access-filter-grid {
  display: grid;
  grid-template-columns: 130px 130px 150px minmax(220px, 1fr) 120px 120px;
  gap: 10px;
  align-items: end;
}

.account-access-filter-grid .control-field {
  min-width: 0;
}

.account-access-log-page #refresh-btn {
  width: 100%;
}

.account-access-exclusion-editor {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 150px;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
}

.account-access-exclusion-editor textarea {
  width: 100%;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  resize: vertical;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  font: inherit;
  line-height: 1.35;
  box-sizing: border-box;
}

.account-access-exclusion-editor textarea:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

.account-access-exclusion-editor button {
  min-height: 42px;
}

.account-access-dashboard {
  grid-template-columns: 1fr;
}

.account-access-panel-summary {
  min-width: 0;
}

.account-access-panel-summary h2,
.account-access-panel-summary p {
  margin-top: 0;
}

.account-access-panel-head #column-settings-btn {
  width: auto;
  min-width: 92px;
}

.account-access-table-scroll {
  max-height: calc(100vh - 360px);
  overflow: auto;
}

.account-access-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.account-access-table td {
  vertical-align: top;
}

.account-access-time,
.account-access-table td[data-column-key="source_ip"],
.account-access-table td[data-column-key="ip_location"],
.account-access-table td[data-column-key="device_type"],
.account-access-table td[data-column-key="event"],
.account-access-table td[data-column-key="request_path"] {
  white-space: nowrap;
}

.account-access-uri {
  display: block;
  max-width: 360px;
  overflow-wrap: anywhere;
}

.account-access-agent {
  max-width: 300px;
  overflow-wrap: anywhere;
}

.account-access-column-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: min(680px, calc(100vh - 32px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 24px 64px rgba(31, 36, 48, 0.28);
}

.account-access-column-dialog::backdrop {
  background: rgba(31, 36, 48, 0.48);
}

.account-access-column-dialog form {
  padding: 20px;
}

.account-access-column-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.account-access-column-dialog-head h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0;
}

.account-access-dialog-close {
  width: 36px;
  min-width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0;
  background: transparent;
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}

.account-access-column-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  max-height: min(420px, calc(100vh - 240px));
  overflow-y: auto;
}

.account-access-column-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  font-size: 14px;
  letter-spacing: 0;
  cursor: pointer;
  box-sizing: border-box;
}

.account-access-column-option:has(input:checked) {
  border-color: var(--brand);
  background: rgba(214, 127, 88, 0.1);
}

.account-access-column-option input {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  accent-color: var(--brand);
}

.account-access-column-option span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.account-access-column-error {
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--danger, #a63d40);
  font-size: 13px;
}

.account-access-column-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.account-access-column-actions button {
  width: auto;
  min-width: 88px;
  border-radius: 6px;
  padding: 10px 14px;
}

@media (max-width: 1000px) {
  .account-access-filter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .account-access-filter-grid {
    grid-template-columns: 1fr;
  }

  .account-access-table-scroll {
    max-height: none;
  }

  .account-access-exclusion-editor {
    grid-template-columns: 1fr;
  }

  .account-access-column-options {
    grid-template-columns: 1fr;
  }

  .account-access-column-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .account-access-column-actions #apply-columns-btn {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .account-access-column-actions button {
    width: 100%;
  }
}

.sell-put-history-review-page .controls {
  padding: 14px 16px 12px;
  border-radius: 18px;
}

.sell-put-history-review-page .hero {
  grid-template-columns: 1fr;
  align-items: start;
}

.sell-put-history-review-page .lede {
  max-width: none;
}

.sell-put-history-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 10px;
  align-items: end;
}

.sell-put-history-filter-grid .control-field {
  min-width: 0;
}

.sell-put-history-review-page #refresh-btn {
  min-width: 88px;
}

.sell-put-history-selection-bar {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  overflow-x: auto;
  overflow-y: visible;
  margin-top: 8px;
  padding-bottom: 2px;
  white-space: nowrap;
}

.sell-put-history-selection-bar .secondary-btn {
  flex: 0 0 auto;
  width: auto;
  min-width: auto;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.1;
}

.sell-put-history-selection-bar #selection-status {
  flex: 1 0 auto;
  min-width: 220px;
  text-align: right;
  font-size: 12px;
}

.selection-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  flex: 0 0 auto;
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(31, 36, 48, 0.05);
  border: 1px solid rgba(31, 36, 48, 0.08);
}

.selection-toggle input {
  margin: 0;
}

.sell-put-history-hover-card {
  position: fixed;
  z-index: 120;
  width: 360px;
  max-width: calc(100vw - 24px);
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(31, 36, 48, 0.12);
  background: rgba(255, 251, 243, 0.96);
  box-shadow: 0 18px 40px rgba(78, 54, 28, 0.18);
  backdrop-filter: blur(10px);
  pointer-events: none;
}

.sell-put-history-hover-card.pinned {
  width: 560px;
  max-height: calc(100vh - 24px);
  overflow: auto;
  pointer-events: auto;
}

.sell-put-history-hover-close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: none;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(31, 36, 48, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.sell-put-history-hover-card.pinned .sell-put-history-hover-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sell-put-history-hover-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 6px;
  padding-right: 30px;
}

.sell-put-history-hover-meta,
.sell-put-history-hover-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.sell-put-history-hover-meta {
  margin-bottom: 8px;
}

.sell-put-history-hover-section + .sell-put-history-hover-section {
  margin-top: 8px;
}

.sell-put-history-hover-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin: 0 0 4px;
}

.sell-put-history-hover-legend {
  margin-top: 8px;
}

.sell-put-history-hover-point-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.62);
  font-size: 11px;
}

.sell-put-history-hover-point-table th,
.sell-put-history-hover-point-table td {
  padding: 6px 7px;
  border-bottom: 1px solid rgba(31, 36, 48, 0.08);
  text-align: left;
  white-space: nowrap;
}

.sell-put-history-hover-point-table th {
  color: var(--muted);
  font-weight: 700;
}

.sell-put-history-hover-point-table tr:last-child td {
  border-bottom: 0;
}

.sell-put-history-hover-pin-hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
}

.sell-put-history-chart-wrap {
  position: relative;
}

.sell-put-history-chart-tooltip {
  position: absolute;
  z-index: 2;
  max-width: min(420px, calc(100% - 16px));
  padding: 7px 9px;
  border-radius: 10px;
  border: 1px solid rgba(31, 36, 48, 0.12);
  background: rgba(31, 36, 48, 0.88);
  color: #fffdf8;
  font-size: 11px;
  line-height: 1.45;
  pointer-events: none;
  box-shadow: 0 10px 24px rgba(31, 36, 48, 0.18);
}

.sell-put-history-mini-chart {
  width: 100%;
  height: auto;
  display: block;
}

.sell-put-history-mini-path {
  fill: none;
  stroke-width: 1.45;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sell-put-history-mini-path.option {
  stroke: var(--accent);
}

.sell-put-history-mini-path.underlying {
  stroke: var(--brand);
}

.sell-put-history-mini-axis-line {
  stroke: rgba(31, 36, 48, 0.16);
  stroke-width: 1;
  shape-rendering: crispEdges;
}

.sell-put-history-mini-axis-line.x {
  stroke: rgba(31, 36, 48, 0.2);
}

.sell-put-history-mini-axis-line.y {
  stroke: rgba(31, 36, 48, 0.2);
}

.sell-put-history-chart-hit {
  fill: rgba(255, 255, 255, 0.01);
  stroke: transparent;
  cursor: crosshair;
  pointer-events: all;
}

.sell-put-history-chart-hit:hover {
  fill: rgba(184, 92, 56, 0.18);
  stroke: rgba(184, 92, 56, 0.4);
}

.sell-put-history-mini-line {
  stroke-width: 1.1;
  stroke-dasharray: 5 4;
}

.sell-put-history-mini-line.open {
  stroke: var(--good);
}

.sell-put-history-mini-line.stop {
  stroke: var(--bad);
}

.sell-put-history-mini-line.strike {
  stroke: rgba(31, 36, 48, 0.58);
  stroke-dasharray: 2 3;
}

.sell-put-history-mini-axis {
  font-size: 11px;
  fill: var(--muted);
}

.sell-put-history-mini-axis.y {
  font-size: 9px;
}

.sell-put-history-mini-axis.strike {
  fill: rgba(31, 36, 48, 0.72);
  font-weight: 700;
}

.legend-chip {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  vertical-align: -1px;
  margin-right: 4px;
}

.legend-chip.open {
  background: var(--good);
}

.legend-chip.stop {
  background: var(--bad);
}

@media (max-width: 900px) {
  .option-fee-filter-grid {
    flex-wrap: wrap;
  }

  .option-fee-filter-grid .control-field {
    flex: 1 1 190px;
    min-width: 190px;
  }

  .sell-put-history-filter-grid {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  }

  .sell-put-history-selection-bar {
    flex-wrap: wrap;
    white-space: normal;
    overflow: visible;
  }

  .sell-put-history-selection-bar #selection-status {
    min-width: 0;
    width: 100%;
    text-align: left;
  }
}

@media (max-width: 640px) {
  .option-fee-filter-grid {
    display: grid;
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .option-fee-filter-grid .control-field {
    min-width: 0;
  }

  .sell-put-history-filter-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .sell-put-history-filter-grid .control-field {
    min-width: 0;
  }
}

.calendar-filter-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.calendar-filter-grid-advanced {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(31, 36, 48, 0.12);
}

.calendar-arb-page #calendar-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.calendar-arb-page #calendar-table .table-scroll {
  max-height: 68vh;
  overflow: auto;
}

.calendar-arb-page #calendar-table table {
  min-width: 1480px;
  font-size: 13px;
}

.calendar-arb-page #calendar-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(255, 251, 243, 0.98);
}

@media (max-width: 1120px) {
  .calendar-arb-page .panel-head {
    align-items: start;
  }

  .calendar-preset-strip {
    justify-content: flex-start;
  }

  .calendar-filter-inline {
    flex-wrap: wrap;
  }

  .calendar-arb-page .calendar-filter-inline .control-field,
  .calendar-arb-page .calendar-filter-inline .control-field:last-child {
    flex: 1 1 220px;
    min-width: 220px;
  }

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

  .calendar-arb-page #calendar-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .calendar-filter-inline {
    display: grid;
    grid-template-columns: 1fr;
  }

  .calendar-arb-page .calendar-filter-inline .control-field,
  .calendar-arb-page .calendar-filter-inline .control-field:last-child {
    min-width: 0;
  }

  .calendar-filter-grid {
    grid-template-columns: 1fr;
  }

  .calendar-arb-page #calendar-summary {
    grid-template-columns: 1fr;
  }
}

.condor-combo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.condor-card {
  border: 1px solid rgba(31, 36, 48, 0.1);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.68);
  display: grid;
  gap: 8px;
}

.condor-card.selected {
  border-color: rgba(184, 92, 56, 0.4);
  background: rgba(184, 92, 56, 0.10);
  box-shadow: 0 10px 24px rgba(184, 92, 56, 0.12);
}

.condor-card.is-manual {
  border-color: rgba(202, 103, 2, 0.28);
  background:
    linear-gradient(135deg, rgba(202, 103, 2, 0.12), rgba(202, 103, 2, 0.03) 28%, rgba(255, 255, 255, 0.72) 28%, rgba(255, 255, 255, 0.72));
  box-shadow: inset 0 0 0 1px rgba(202, 103, 2, 0.06);
}

.condor-card.is-manual.selected {
  border-color: rgba(202, 103, 2, 0.46);
  background:
    linear-gradient(135deg, rgba(202, 103, 2, 0.16), rgba(202, 103, 2, 0.06) 30%, rgba(184, 92, 56, 0.12) 30%, rgba(184, 92, 56, 0.12));
  box-shadow: 0 12px 28px rgba(202, 103, 2, 0.16);
}

.condor-card header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.condor-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}

.condor-legs {
  font-size: 15px;
}

.condor-payoff {
  width: 100%;
  height: 96px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(31, 36, 48, 0.1);
  border-radius: 12px;
}

.condor-payoff line {
  stroke: rgba(31, 36, 48, 0.16);
  stroke-width: 1;
}

.condor-payoff polyline {
  fill: none;
  stroke: var(--brand);
  stroke-width: 2;
}

.condor-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.iron-condor-lab-page #combo-table {
  overflow-x: auto;
}

.iron-condor-lab-page #combo-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 900px;
}

.iron-condor-lab-page #combo-table th,
.iron-condor-lab-page #combo-table td {
  border-bottom: 1px solid rgba(31, 36, 48, 0.08);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

.iron-condor-lab-page #combo-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.iron-condor-lab-page .combo-row {
  cursor: pointer;
}

.iron-condor-lab-page .combo-row.selected {
  background: rgba(184, 92, 56, 0.10);
}

.iron-condor-lab-page .combo-row.selected td {
  border-bottom-color: rgba(184, 92, 56, 0.18);
}

.iron-condor-lab-page .combo-row.manual-row td {
  background-image: linear-gradient(90deg, rgba(202, 103, 2, 0.12), rgba(202, 103, 2, 0.03));
}

.iron-condor-lab-page .combo-row.manual-row td:first-child {
  box-shadow: inset 4px 0 0 rgba(202, 103, 2, 0.62);
}

.iron-condor-lab-page .combo-row.manual-row.selected td {
  background-image: linear-gradient(90deg, rgba(202, 103, 2, 0.18), rgba(184, 92, 56, 0.10));
}

.iron-condor-lab-page .combo-row.risk-conflict-high td {
  background: rgba(214, 40, 40, 0.08);
}

.iron-condor-lab-page .combo-row.risk-conflict-medium td {
  background: rgba(202, 103, 2, 0.08);
}

.iron-condor-lab-page .risk-signal-pill {
  display: inline-block;
  margin-top: 4px;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 11px;
  line-height: 1.5;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.iron-condor-lab-page .risk-signal-pill.high {
  color: #8f1f1f;
  background: rgba(214, 40, 40, 0.13);
  border-color: rgba(176, 30, 30, 0.35);
}

.iron-condor-lab-page .risk-signal-pill.medium {
  color: #9a5312;
  background: rgba(202, 103, 2, 0.14);
  border-color: rgba(202, 103, 2, 0.32);
}

.iron-condor-lab-page .risk-signal-pill.low {
  color: #0b7a54;
  background: rgba(11, 122, 84, 0.14);
  border-color: rgba(11, 122, 84, 0.32);
}

.iron-condor-lab-page .risk-signal-pill.unknown {
  color: var(--muted);
  background: rgba(31, 36, 48, 0.08);
  border-color: rgba(31, 36, 48, 0.16);
}

.iron-condor-lab-page .hv-signal-pill {
  display: inline-block;
  margin-top: 4px;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 11px;
  line-height: 1.5;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.iron-condor-lab-page .hv-signal-pill.good {
  color: #0b7a54;
  background: rgba(11, 122, 84, 0.14);
  border-color: rgba(11, 122, 84, 0.32);
}

.iron-condor-lab-page .hv-signal-pill.warn {
  color: #9a5312;
  background: rgba(202, 103, 2, 0.14);
  border-color: rgba(202, 103, 2, 0.32);
}

.iron-condor-lab-page .hv-signal-pill.bad {
  color: #8f1f1f;
  background: rgba(214, 40, 40, 0.13);
  border-color: rgba(176, 30, 30, 0.35);
}

.iron-condor-lab-page .hv-signal-pill.unknown {
  color: var(--muted);
  background: rgba(31, 36, 48, 0.08);
  border-color: rgba(31, 36, 48, 0.16);
}

.iron-condor-lab-page .manual-combo-panel {
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 20px;
  border: 1px solid rgba(31, 36, 48, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(244, 247, 251, 0.74));
  display: grid;
  gap: 8px;
}

.iron-condor-lab-page .manual-combo-panel.is-empty {
  padding-bottom: 10px;
}

.iron-condor-lab-page .manual-combo-panel-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.iron-condor-lab-page .manual-combo-panel-head h3 {
  margin: 0;
  font-size: 15px;
}

.iron-condor-lab-page #manual-combo-meta,
.iron-condor-lab-page .manual-combo-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
}

.iron-condor-lab-page .manual-combo-grid {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.iron-condor-lab-page .manual-combo-inline-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0 10px;
  min-height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(31, 36, 48, 0.10);
  background: rgba(255, 255, 255, 0.88);
}

.iron-condor-lab-page .manual-combo-inline-field span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: uppercase;
}

.iron-condor-lab-page .manual-combo-inline-field input {
  width: 110px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-size: 13px;
}

.iron-condor-lab-page .manual-combo-inline-field input:focus {
  outline: none;
}

.iron-condor-lab-page #manual-combo-add-btn,
.iron-condor-lab-page #manual-combo-clear-btn {
  min-height: 40px;
  padding: 0 14px;
  white-space: nowrap;
}

.iron-condor-lab-page #manual-combo-status {
  flex: 1 1 240px;
  min-width: 180px;
  min-height: 0;
  font-size: 12px;
  line-height: 1.35;
}

.iron-condor-lab-page .manual-combo-list {
  display: grid;
  gap: 8px;
}

.iron-condor-lab-page .manual-combo-list:empty {
  display: none;
}

.iron-condor-lab-page .manual-combo-card {
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(31, 36, 48, 0.08);
  background: rgba(255, 255, 255, 0.78);
  display: grid;
  gap: 8px;
}

.iron-condor-lab-page .manual-combo-card.is-error {
  border-color: rgba(176, 30, 30, 0.28);
  background: rgba(255, 243, 243, 0.88);
}

.iron-condor-lab-page .manual-combo-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.iron-condor-lab-page .manual-combo-card-title {
  font-weight: 700;
  color: var(--accent);
}

.iron-condor-lab-page .manual-combo-card-metrics {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}

.iron-condor-lab-page .manual-combo-card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.iron-condor-lab-page .combo-source-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.iron-condor-lab-page .combo-source-pill.auto {
  color: #1d4ed8;
  background: rgba(29, 78, 216, 0.10);
  border-color: rgba(29, 78, 216, 0.20);
}

.iron-condor-lab-page .combo-source-pill.manual {
  color: #9a5312;
  background: rgba(202, 103, 2, 0.12);
  border-color: rgba(202, 103, 2, 0.24);
}

@media (max-width: 960px) {
  .iron-condor-lab-page .manual-combo-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    align-items: stretch;
  }

  .iron-condor-lab-page .manual-combo-inline-field {
    width: 100%;
  }

  .iron-condor-lab-page .manual-combo-inline-field input {
    width: 100%;
  }

  .iron-condor-lab-page #manual-combo-status {
    grid-column: 1 / -1;
    min-width: 0;
  }
}

@media (max-width: 640px) {
  .iron-condor-lab-page .manual-combo-grid {
    grid-template-columns: 1fr;
  }

  .iron-condor-lab-page .manual-combo-card-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .iron-condor-lab-page .manual-combo-panel-head {
    align-items: flex-start;
  }
}

.iron-condor-lab-page .position-sizing-panel {
  display: grid;
  gap: 14px;
}

.iron-condor-lab-page .position-sizing-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.iron-condor-lab-page .position-sizing-note {
  flex: 0 1 auto;
}

.iron-condor-lab-page .position-sizing-inline-field {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.iron-condor-lab-page .position-sizing-inline-field input {
  width: 120px;
  padding: 10px 12px;
  font-size: 14px;
}

.iron-condor-lab-page .position-sizing-selection {
  flex: 1 1 320px;
  margin-top: 0;
}

.iron-condor-lab-page .summary-card {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(31, 36, 48, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.80), rgba(255, 255, 255, 0.60));
  display: grid;
  gap: 6px;
}

.iron-condor-lab-page .summary-card h3 {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.iron-condor-lab-page .summary-card p {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
}

.iron-condor-lab-page .summary-card span {
  font-size: 12px;
  line-height: 1.45;
}

.iron-condor-lab-page .education-panel {
  display: grid;
  gap: 14px;
}

.iron-condor-lab-page .education-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.iron-condor-lab-page .education-card {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(31, 36, 48, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.58));
}

.iron-condor-lab-page .education-card h3 {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--accent);
}

.iron-condor-lab-page .education-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
}

.iron-condor-lab-page .education-card p + p {
  margin-top: 8px;
}

.iron-condor-lab-page .education-card code,
.iron-condor-lab-page .education-note code {
  font-size: 0.95em;
}

.iron-condor-lab-page .education-example {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(31, 36, 48, 0.04);
  border: 1px solid rgba(31, 36, 48, 0.08);
  line-height: 1.6;
  color: var(--ink);
}

.iron-condor-lab-page .atm-quote-wrap {
  margin-top: 10px;
  overflow-x: auto;
}

.iron-condor-lab-page .atm-quote-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.iron-condor-lab-page .atm-quote-table th,
.iron-condor-lab-page .atm-quote-table td {
  border-bottom: 1px solid rgba(31, 36, 48, 0.09);
  padding: 6px 8px;
  text-align: left;
  white-space: nowrap;
}

.iron-condor-lab-page .atm-quote-table th {
  color: var(--muted);
  font-weight: 600;
}

.iron-condor-lab-page .atm-quote-table tr.is-atm {
  background: rgba(11, 122, 84, 0.08);
}

.iron-condor-lab-page .atm-pill {
  display: inline-block;
  margin-left: 4px;
  border-radius: 999px;
  background: rgba(11, 122, 84, 0.16);
  color: #0b7a54;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  letter-spacing: 0.04em;
}

.iron-condor-lab-page .education-note {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px dashed rgba(31, 36, 48, 0.16);
  background: rgba(31, 36, 48, 0.04);
  line-height: 1.6;
  color: var(--ink);
}

.help-tip {
  cursor: help;
  text-decoration: underline dotted;
  text-underline-offset: 2px;
}

.leg-tooltip {
  position: relative;
}

.leg-tooltip:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 30;
  min-width: 320px;
  max-width: 480px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(31, 36, 48, 0.16);
  background: rgba(255, 251, 243, 0.98);
  box-shadow: 0 10px 26px rgba(31, 36, 48, 0.18);
  white-space: pre-line;
  line-height: 1.4;
  font-size: 12px;
  color: var(--ink);
}

.calc-tooltip {
  position: relative;
}

.calc-tooltip:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 30;
  min-width: 260px;
  max-width: 380px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(31, 36, 48, 0.16);
  background: rgba(255, 251, 243, 0.98);
  box-shadow: 0 10px 26px rgba(31, 36, 48, 0.18);
  white-space: normal;
  line-height: 1.35;
  font-size: 12px;
  color: var(--ink);
  text-transform: none;
  letter-spacing: 0;
}

#status.status-error {
  color: var(--bad);
  font-weight: 600;
}

.overlay-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.overlay-chart-wrap {
  border: 1px solid rgba(31, 36, 48, 0.1);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.overlay-chart-svg {
  width: 100%;
  height: 220px;
  display: block;
  border: 1px solid rgba(31, 36, 48, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.88);
}

.overlay-chart-svg line {
  stroke: rgba(31, 36, 48, 0.2);
  stroke-width: 0.8;
}

.overlay-chart-svg polyline {
  fill: none;
  stroke-width: 1.9;
}

.overlay-axis {
  margin-top: 8px;
  font-size: 12px;
}

.overlay-legend {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.overlay-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.overlay-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid rgba(31, 36, 48, 0.2);
}

@media (max-width: 760px) {
  .iron-condor-lab-page .position-sizing-toolbar {
    align-items: stretch;
  }

  .iron-condor-lab-page .position-sizing-inline-field {
    justify-content: space-between;
    width: 100%;
  }

  .iron-condor-lab-page .position-sizing-inline-field input {
    width: 140px;
  }

  .iron-condor-lab-page .education-grid {
    grid-template-columns: 1fr;
  }
}

.option-sim-orders-page .hero {
  grid-template-columns: 1fr 0.85fr;
}

.option-sim-orders-page .controls {
  align-self: stretch;
}

.option-sim-orders-page .summary-card p {
  font-size: 22px;
}

.option-sim-orders-page .sim-orders-table {
  font-size: 13px;
}

.option-sim-orders-page .sim-orders-table th,
.option-sim-orders-page .sim-orders-table td {
  padding: 8px 6px;
}

.option-sim-orders-page .sim-order-actions {
  min-width: 460px;
}

.option-sim-orders-page .sim-order-row-actions {
  margin-bottom: 8px;
}

.option-sim-orders-page .sim-order-row-actions button {
  width: auto;
  min-width: 86px;
}

.option-sim-orders-page .sim-close-controls {
  display: grid;
  grid-template-columns: minmax(150px, 0.9fr) minmax(120px, 0.7fr) minmax(180px, 1.1fr);
  gap: 8px;
  align-items: end;
}

.option-sim-orders-page .sim-close-controls label {
  margin: 0;
}

.option-sim-orders-page .sim-close-controls label span {
  font-size: 11px;
}

.option-sim-orders-page .sim-close-controls input,
.option-sim-orders-page .sim-close-controls select {
  width: 100%;
}

.option-sim-orders-page .sim-close-action-row {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  align-items: end;
}

.option-sim-orders-page .sim-close-action-row > button {
  width: auto;
  min-width: 98px;
}

.option-sim-orders-page .sim-close-action-row > label {
  flex: 1 1 auto;
}

.option-sim-orders-page .sim-save-trial-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0 2px;
}

.option-sim-orders-page .sim-save-trial-toggle input {
  width: auto;
}

.option-sim-orders-page .sim-source-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  margin-right: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.option-sim-orders-page .sim-source-chip-live {
  color: #14532d;
  background: rgba(34, 197, 94, 0.18);
}

.option-sim-orders-page .sim-source-chip-mirror {
  color: #9a3412;
  background: rgba(251, 146, 60, 0.18);
}

.option-sim-orders-page .sim-order-fold,
.option-sim-orders-page .sim-trial-panels {
  margin-top: 10px;
}

.option-sim-orders-page .sim-order-fold,
.option-sim-orders-page .sim-trial-panel {
  border: 1px solid rgba(31, 36, 48, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.56);
}

.option-sim-orders-page .sim-order-fold summary,
.option-sim-orders-page .sim-trial-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
  font-size: 12px;
  font-weight: 600;
}

.option-sim-orders-page .sim-order-fold summary::-webkit-details-marker,
.option-sim-orders-page .sim-trial-panel summary::-webkit-details-marker {
  display: none;
}

.option-sim-orders-page .sim-fold-summary-meta {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.option-sim-orders-page .sim-order-fold-body,
.option-sim-orders-page .sim-trial-panel-body {
  padding: 0 10px 10px;
}

.option-sim-orders-page .sim-trial-panels {
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.option-sim-orders-page .sim-trial-panel {
  overflow: hidden;
}

.option-sim-orders-page .sim-trials-table {
  font-size: 12px;
}

@media (max-width: 1100px) {
  .option-sim-orders-page .hero {
    grid-template-columns: 1fr;
  }

  .option-sim-orders-page .sim-order-actions {
    min-width: 320px;
  }

  .option-sim-orders-page .sim-close-controls {
    grid-template-columns: 1fr 1fr;
  }

  .option-sim-orders-page .sim-trial-panels {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .option-sim-orders-page .sim-close-controls {
    grid-template-columns: 1fr;
  }

  .option-sim-orders-page .sim-close-action-row {
    flex-wrap: wrap;
  }

  .option-sim-orders-page .sim-close-action-row > button {
    min-width: 84px;
  }
}
