:root {
  --bg: #ffffff;
  --muted: #6b7280;
  --line: #e5e7eb;
  --chip: #f3f4f6;
  --pill: #dcfce7;
  --pill2: #ecfeff;
}
body { margin:0; font-family: ui-sans-serif, system-ui, -apple-system; background: var(--bg); color:#111827; }
.page { max-width: 2000px; margin: 18px auto; padding: 0 14px; }
.pill { display:inline-block; padding:2px 8px; border-radius:999px; background: var(--pill); border:1px solid #86efac; font-size:12px; }

.filters {
  margin-top: 12px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  gap: 6px;
  align-items: stretch;
  flex-wrap: wrap;
  background: #fbfbfc;
}
.chip {
  align-self: center;
  background: var(--chip);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.f {
  display: flex;
  gap: 5px;
  align-items: center;
  min-height: 30px;
  padding: 3px 6px;
  border: 1px solid #eef0f3;
  border-radius: 9px;
  background: #fff;
  font-size: 12px;
}
.f > span:first-child {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.f input,
.f select {
  box-sizing: border-box;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 7px;
  background: #fff;
  font-size: 12px;
}
.f input[type="number"] {
  width: 58px;
  min-width: 58px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.f input[type="text"] {
  width: 132px;
  min-width: 96px;
}
.f select {
  max-width: 170px;
}
#vMode {
  max-width: 260px;
}
#ulOnly,
#ulExclude {
  width: 150px;
}
#closedSearch {
  width: 180px;
}
.f.wide input {
  width: 170px;
}
.f.check {
  gap: 6px;
  padding-right: 8px;
}
.f.check input {
  width: 14px;
  min-width: 14px;
  height: 14px;
  padding: 0;
}
.f.check > span {
  color: #374151;
  font-size: 12px;
  font-weight: 600;
}
.f.preferred-only-filter {
  border-color: #86efac;
  background: #f0fdf4;
}
.f.preferred-only-filter > span {
  color: #065f46;
  font-weight: 800;
}
.f.preferred-only-filter > span::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: 50%;
  background: #10b981;
  vertical-align: 1px;
}
.f.unfavorable-only-filter {
  border-color: #fca5a5;
  background: #fef2f2;
}
.f.unfavorable-only-filter > span {
  color: #991b1b;
  font-weight: 800;
}
.f.unfavorable-only-filter > span::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: 50%;
  background: #ef4444;
  vertical-align: 1px;
}
.filters .muted {
  font-size: 11px;
  white-space: nowrap;
}
.calendar-filters {
  display: block;
  padding: 0 10px;
}
.calendar-filters .filter-group {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  min-height: 38px;
  padding: 7px 0;
}
.calendar-filters .filter-group + .filter-group {
  border-top: 1px solid var(--line);
}
.calendar-filters .filter-group-title {
  flex: 0 0 82px;
  color: #374151;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}
.calendar-filters .filter-help {
  flex: 1 0 100%;
  margin-left: 88px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}
.calendar-filters .btn {
  height: 30px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
}
.calendar-filters .primary-filter-action {
  border-color: #9ca3af;
  background: #111827;
  color: #fff;
}
.calendar-filters .filter-management .right {
  margin-left: auto;
}
.muted { color: var(--muted); }
.right {
  margin-left: auto;
  min-height: 30px;
  padding: 3px 0;
  font-size: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.metrics { margin-left: 6px; }
.refresh-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 82px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.refresh-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.35);
}
.refresh-indicator.is-loading .refresh-dot {
  animation: refreshPulse 0.9s ease-out infinite;
}
@keyframes refreshPulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45); }
  100% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.home-tile {
  display: block;
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: inherit;
  text-decoration: none;
}
.home-tile:hover {
  border-color: #9ca3af;
  background: #f9fafb;
}
.home-tile b {
  display: block;
  margin-bottom: 8px;
  font-size: 16px;
}
.home-tile span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.btn { height:30px; border:1px solid var(--line); border-radius:9px; padding:0 11px; background:#fff; cursor:pointer; }
.filters > .btn { align-self: center; height: 30px; padding: 0 12px; font-size: 12px; font-weight: 700; }
.btn2 { height:28px; border:1px solid var(--line); border-radius:10px; padding:0 10px; background:#fff; cursor:pointer; }
.favbtn.is-active {
  border-color: #f59e0b;
  background: #fffbeb;
  color: #92400e;
  font-weight: 700;
}
.monitorbtn.is-active {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 700;
}
.waitingbtn.is-active {
  border-color: #f59e0b;
  background: #fffbeb;
  color: #92400e;
  font-weight: 700;
}
.monitorbtn.is-roll {
  border-color: #0f766e;
  background: #f0fdfa;
  color: #115e59;
  font-weight: 700;
}

@media (max-width: 760px) {
  .filters {
    gap: 6px;
    padding: 7px;
  }
  .filters .chip {
    flex: 1 0 100%;
  }
  .filters .f {
    flex: 1 1 150px;
    justify-content: space-between;
  }
  .filters .f.check {
    justify-content: flex-start;
  }
  .filters .f input[type="text"],
  .filters .f.wide input,
  #ulOnly,
  #ulExclude,
  #closedSearch {
    width: min(170px, 52vw);
  }
  .filters .f select {
    max-width: min(180px, 52vw);
  }
  .filters > .btn {
    flex: 1 1 92px;
  }
  .filters .right {
    flex: 1 0 100%;
    margin-left: 0;
  }
  .calendar-filters {
    padding: 0 7px;
  }
  .calendar-filters .filter-group {
    align-items: stretch;
  }
  .calendar-filters .filter-group-title {
    flex: 1 0 100%;
    padding-top: 2px;
  }
  .calendar-filters .filter-help {
    margin-left: 0;
  }
  .calendar-filters .filter-management .right {
    margin-left: 0;
  }
}

.tablewrap {
  max-width: 100%;
  margin-top:12px;
  border:1px solid var(--line);
  border-radius:12px;
  overflow-x:auto;
  overflow-y:hidden;
  -webkit-overflow-scrolling:touch;
}
.tbl { width:100%; border-collapse:separate; border-spacing:0; font-size:13px; }
.dc-scan-table { min-width: 1500px; }
.tbl th {
  background:#f9fafb;
  padding:10px 8px;
  text-align:left;
  border-bottom:1px solid var(--line);
  white-space:nowrap;
}
.tbl td {
  padding:10px 8px;
  border-bottom:1px solid var(--line);
  vertical-align:middle;
  white-space:nowrap;
}

/* заголовок выравнивается как ячейки */
.tbl th.num { text-align:right; font-variant-numeric: tabular-nums; }
.tbl td.num { text-align:right; font-variant-numeric: tabular-nums; }

/* визуальное отделение ячеек */
.tbl th, .tbl td { border-right:1px solid var(--line); }
.tbl th:last-child, .tbl td:last-child { border-right:none; }

.tbl td.act { min-width:140px; }
.tbl tr.row:hover { background:#fafafa; }
.tbl tr.is-favorite { background:#fffbeb; }
.tbl tr.is-favorite:hover { background:#fef3c7; }
.tbl tr.row.is-normal-iv-setup > td { background:#ecfdf5; }
.tbl tr.row.is-normal-iv-setup:hover > td { background:#dcfce7; }
.tbl tr.row.is-normal-iv-setup > td:first-child { box-shadow:inset 4px 0 #10b981; }
.tbl tr.row.is-red-iv-setup > td { background:#fef2f2; }
.tbl tr.row.is-red-iv-setup:hover > td { background:#fee2e2; }
.tbl tr.row.is-red-iv-setup > td:first-child { box-shadow:inset 4px 0 #ef4444; }
.exp { width:28px; height:28px; border:1px solid var(--line); border-radius:10px; background:#fff; cursor:pointer; }

/* сортировка по клику */
.tbl th.sortable, .t th.sortable, .tbl th.expirySortable { cursor:pointer; user-select:none; }
.tbl th.sortable:hover, .t th.sortable:hover, .tbl th.expirySortable:hover { background:#f3f4f6; }
.tbl th.sortable::after, .t th.sortable::after, .tbl th.expirySortable::after {
  content: attr(data-arrow);
  margin-left: 6px;
  color: var(--muted);
  font-size: 11px;
}

.tag { display:inline-block; min-width:22px; text-align:center; padding:2px 7px; border-radius:999px; font-weight:600; font-size:12px; border:1px solid var(--line); }
.tag.c { background:#ecfeff; border-color:#a5f3fc; }
.tag.p { background:#f5f3ff; border-color:#ddd6fe; }
.tag.live { background:#fee2e2; border-color:#fecaca; color:#991b1b; }
.event-tags {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}
.miniSource {
  display: inline-block;
  margin-left: 4px;
  color: #991b1b;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.pill2 { display:inline-block; padding:2px 8px; border-radius:999px; background: var(--pill2); border:1px solid #a5f3fc; }

.expand-row td { background:#fbfbff; }
.expand-cell { padding:12px; }
.expand-grid { display:grid; grid-template-columns: 340px 1fr; gap:12px; }
.card { border:1px solid var(--line); border-radius:12px; padding:10px; background:#fff; }
.card-title { font-size:12px; color: var(--muted); font-weight:700; letter-spacing:0.04em; margin-bottom:8px; }
.kv { display:grid; grid-template-columns: 120px 1fr; gap:6px 10px; font-size:13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas; font-size:12px; }
.row2 { display:flex; gap:8px; align-items:center; margin-bottom:8px; }
.ladder { max-height: 260px; overflow:auto; }

.tbl2 { width:100%; border-collapse:separate; border-spacing:0; font-size:13px; }
.tbl2 th { background:#f9fafb; padding:8px 6px; border-bottom:1px solid var(--line); border-right:1px solid var(--line); }
.tbl2 td { padding:8px 6px; border-bottom:1px solid var(--line); border-right:1px solid var(--line); }
.tbl2 th:last-child, .tbl2 td:last-child { border-right:none; }
.tbl2 td.num { text-align:right; font-variant-numeric: tabular-nums; }


/* ladder sections */
.ladder-section{margin-bottom:12px;}
.ladder-title{font-size:12px;color:var(--muted);font-weight:700;letter-spacing:0.03em;margin:6px 0;}

.tbl td.dc-ff-col { padding-top: 6px; padding-bottom: 6px; }
.dc-ff-cell { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.dc-ff-cell > strong { color: inherit; font-size: 14px; line-height: 1.1; }
.dc-ff-cell > small { display: grid; gap: 1px; color: var(--muted); font-size: 10px; line-height: 1.25; }
.dc-ff-cell > small > span { display: grid; grid-template-columns: 20px auto; gap: 5px; }
.dc-ff-cell > small b { color: #9ca3af; font-weight: 600; }
.normalized-iv-cell > strong { font-size: 16px; font-weight: 800; }
.normalized-iv-cell > small > span { grid-template-columns: 28px auto; }
.dc-ff-empty { color: #c4c8cf; }
.tbl .dc-exp-col { width: 104px; min-width: 104px; white-space: nowrap; }
.tbl td.dc-exp-col small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.screener-panel table.paper .dc-exp-col { width: 104px; min-width: 104px; text-align: right; }
.screener-panel table.paper td.dc-exp-col small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }

.favoriteswrap {
  margin-top: 12px;
}

.monitorwrap {
  margin-top: 12px;
}

.screener-panel {
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: #fff;
}

.screener-panel > summary {
  cursor: pointer;
  padding: 10px 12px;
  font-size: 13px;
  border-bottom: 1px solid var(--line);
  background: #eff6ff;
  border-radius: 12px 12px 0 0;
}

.screener-panel:not([open]) > summary {
  border-bottom: none;
  border-radius: 12px;
}

.monitor-summary-status {
  margin-left: 8px;
  color: var(--muted);
  font-weight: 400;
}

.monitor-order-budget {
  margin-left: 10px;
  color: #334155;
  font-weight: 600;
  white-space: nowrap;
}

.monitor-order-budget.is-uncertain {
  color: #a16207;
}

.monitor-order-budget.is-over {
  color: #b91c1c;
}

.monitor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  flex-wrap: wrap;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  font-size: 11px;
}

.monitor-toolbar-meta,
.monitor-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.monitor-toolbar-actions {
  margin-left: auto;
}

.monitor-toolbar .monitor-summary-status,
.monitor-toolbar .monitor-order-budget {
  margin-left: 0;
}

.monitorwrap .ui-disclosure-title > .monitor-capacity-status {
  font-size: 11px;
}

.monitor-capacity-detail {
  color: var(--muted);
  font-size: 11px;
}

.monitor-capacity-detail.is-blocked {
  color: #b91c1c;
  font-weight: 600;
}

@media (max-width: 720px) {
  .monitor-toolbar {
    align-items: flex-start;
  }

  .monitor-toolbar-meta,
  .monitor-toolbar-actions {
    flex: 1 1 100%;
  }

  .monitor-toolbar-actions {
    margin-left: 0;
  }
}

.monitor-tablewrap {
  margin-top: 0;
  border: none;
  border-radius: 0 0 12px 12px;
}

.monitor-table td {
  padding-top: 7px;
  padding-bottom: 7px;
}

.monitor-table [data-monitor-column][hidden],
.monitor-table .monitor-payoff-detail[hidden] {
  display: none !important;
}

#calendarResults .tbl [data-calendar-column][hidden] {
  display: none !important;
}

.column-settings-card,
.monitor-column-settings-card {
  grid-column: 1 / -1;
}

.column-settings-grid,
.monitor-column-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 6px 14px;
}

.column-settings-grid .calendar-setting-toggle,
.monitor-column-settings-grid .calendar-setting-toggle {
  min-height: 28px;
}

.monitor-vol-structure-col {
  min-width: 126px;
}

/* WAITING has compact controls and read-only metrics, so it does not need the
   wider MONITOR action/form columns. */
.waiting-table .monitor-hour-range {
  width: 92px;
  min-width: 92px;
  max-width: 92px;
  white-space: normal;
}

.waiting-table th[data-waiting-sort="range-1h"] > span {
  display: block;
}

.waiting-table .waiting-payoff {
  width: 86px;
  min-width: 86px;
  max-width: 86px;
  white-space: normal;
}

.waiting-table .waiting-payoff b,
.waiting-table .waiting-payoff small {
  display: block;
}

.waiting-table .monitor-vol-structure-col {
  width: 160px;
  min-width: 160px;
  max-width: 160px;
  white-space: normal;
}

.waiting-table .monitor-vol-structure {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
}

.waiting-table .monitor-vol-structure > span {
  grid-template-columns: minmax(0, 58px) minmax(0, 1fr);
}

.waiting-table .monitor-vol-structure b,
.waiting-table .monitor-vol-structure strong {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
}

.waiting-table .waiting-strength-column {
  box-sizing: border-box;
  width: 160px;
  min-width: 160px;
  max-width: 160px;
  white-space: normal;
  text-align: left;
}

.waiting-strength {
  display: grid;
  gap: 2px;
  font-size: 10px;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}

.waiting-strength-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px 6px;
  margin-bottom: 2px;
}

.waiting-strength-summary > strong { font-size: 14px; }
.waiting-strength-summary > small { font-size: 10px; color: var(--muted); }
.waiting-strength-stale { color: #b45309; }
.waiting-strength-component {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}
.waiting-strength-component > b { color: var(--muted); font-weight: 400; white-space: nowrap; }
.waiting-strength-component > strong { text-align: right; font-weight: 500; }
.waiting-strength-penalty { font-size: 10px; color: #b45309; overflow-wrap: anywhere; }

.waiting-table .waiting-payoff > b { font-size: 11px; }
.waiting-table .waiting-payoff > small,
.waiting-table .waiting-row-meta {
  font-size: 10px;
  line-height: 1.3;
  color: var(--muted);
}
.waiting-table .waiting-payoff > small { margin-top: 2px; }

.waiting-table .waiting-actions-column {
  box-sizing: border-box;
  width: 68px;
  min-width: 68px;
  max-width: 68px;
}

.monitor-table.waiting-table .monitor-actions .monitor-action-buttons {
  display: flex;
  flex-flow: column nowrap;
  align-items: stretch;
  align-content: normal;
  grid-template-columns: none;
  grid-auto-rows: auto;
  width: 100%;
  min-height: 0;
}

.waiting-table .monitor-actions .btn2 {
  width: 100%;
}

.monitor-table .monitor-liquidity-col {
  width: 88px;
  min-width: 0;
  max-width: 88px;
  text-align: left;
  white-space: normal;
}

.monitor-table .monitor-liquidity-col .monitor-liquidity {
  min-width: 0;
  max-width: 88px;
  white-space: normal;
  overflow-wrap: anywhere;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: 10px;
  line-height: 1.25;
}

.monitor-liquidity-col .monitor-liquidity small {
  font-size: inherit;
}

.monitor-liquidity {
  display: inline-grid;
  gap: 1px;
  min-width: 104px;
  padding: 4px 6px;
  border-radius: 7px;
  background: #f8fafc;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: left;
}

.monitor-liquidity strong {
  color: var(--muted);
}

.calendar-liquidity {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  white-space: nowrap;
  line-height: 1.2;
}

.calendar-liquidity small {
  font-size: .78rem;
}

.monitor-liquidity.is-ok {
  background: #ecfdf5;
  box-shadow: inset 3px 0 #10b981;
}

.monitor-liquidity.is-ok strong {
  color: #047857;
}

.monitor-liquidity.is-wait {
  background: #fff7ed;
  box-shadow: inset 3px 0 #f97316;
}

.monitor-liquidity.is-wait strong {
  color: #c2410c;
}

.monitor-vol-structure {
  display: inline-grid;
  gap: 2px;
  width: 118px;
  padding: 4px 6px;
  border-radius: 7px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.monitor-vol-structure.is-preferred {
  background: #ecfdf5;
  box-shadow: inset 3px 0 #10b981;
}

.monitor-vol-structure > span {
  display: grid;
  grid-template-columns: 58px 1fr;
  align-items: baseline;
  gap: 5px;
}

.monitor-vol-structure b {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
}

.monitor-vol-structure strong {
  text-align: right;
  white-space: nowrap;
}

.monitor-structure b,
.monitor-structure small,
.monitor-range b,
.monitor-range small,
.monitor-hour-range b,
.monitor-hour-range small {
  display: block;
}

.monitor-structure small,
.monitor-range small,
.monitor-hour-range small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.monitor-roll-label {
  display: block;
  width: max-content;
  margin-top: 4px;
  padding: 2px 6px;
  border: 1px solid #5eead4;
  border-radius: 999px;
  color: #115e59;
  background: #ccfbf1;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.monitor-roll-suggestion {
  display: block;
  width: max-content;
  margin-top: 4px;
  padding: 2px 6px;
  border: 1px solid #2dd4bf;
  border-radius: 999px;
  color: #134e4a;
  background: #f0fdfa;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.monitor-roll-suggestion.is-stale {
  color: var(--muted);
  border-color: color-mix(in srgb, var(--muted) 55%, transparent);
  background: transparent;
}

/* Reserve both the historical ROLLED badge and the live ROLL WATCH line so
   discovering a candidate never moves the action buttons vertically. */
.monitor-roll-slot {
  display: block;
  min-height: 21px;
  margin-top: 4px;
}

.monitor-roll-slot > .monitor-roll-label,
.monitor-roll-slot > .monitor-roll-suggestion {
  margin-top: 0;
}

.monitor-actions .monitor-roll-action {
  border-color: #0f766e;
  background: #ccfbf1;
  color: #115e59;
  font-weight: 800;
}

.monitor-range small.better { color: #047857; }
.monitor-range small.worse { color: #b91c1c; }
.monitor-current b,
.monitor-hour-range b { font-variant-numeric: tabular-nums; }

.monitor-quote-values {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.monitor-quote-values > small,
.monitor-quote-values > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
}

.monitor-quote-values > b {
  font-size: 14px;
  font-weight: 700;
}

.monitor-table tr.monitor-auto-armed > td {
  background: #dbeafe;
  transition: background-color 160ms ease;
}

.monitor-table tr.monitor-auto-armed:hover > td {
  background: #bfdbfe;
}

.monitor-table tr.monitor-auto-armed > td:first-child {
  box-shadow: inset 5px 0 #1d4ed8;
}

.monitor-table tr.monitor-position-active > td {
  background: #dcfce7;
  transition: background-color 160ms ease;
}

.monitor-table tr.monitor-position-active:hover > td {
  background: #bbf7d0;
}

.monitor-table tr.monitor-position-active > td:first-child {
  box-shadow: inset 5px 0 #16a34a;
}

.monitor-table tr.monitor-entry-working > td {
  background: #fef3c7;
  transition: background-color 160ms ease;
}

.monitor-table tr.monitor-entry-working:hover > td {
  background: #fde68a;
}

.monitor-table tr.monitor-entry-working > td:first-child {
  box-shadow: inset 5px 0 #d97706;
}

.monitor-table tr.monitor-auto-rolling > td {
  background: #ede9fe;
  transition: background-color 160ms ease;
}

.monitor-table tr.monitor-auto-rolling:hover > td {
  background: #ddd6fe;
}

.monitor-table tr.monitor-auto-rolling > td:first-child {
  box-shadow: inset 5px 0 #7c3aed;
}

.monitor-table tr.monitor-take-profit > td {
  background: #ccfbf1;
  transition: background-color 160ms ease;
}

.monitor-table tr.monitor-take-profit:hover > td {
  background: #99f6e4;
}

.monitor-table tr.monitor-take-profit > td:first-child {
  box-shadow: inset 5px 0 #0f766e;
}

.monitor-table tr.monitor-auto-exit > td {
  background: #dcfce7;
  transition: background-color 160ms ease;
}

.monitor-table tr.monitor-auto-exit:hover > td {
  background: #bbf7d0;
}

.monitor-table tr.monitor-auto-exit > td:first-child {
  box-shadow: inset 5px 0 #16a34a;
}

.monitor-table tr.monitor-entry-paused > td:last-child {
  box-shadow: inset -5px 0 #dc2626;
}

.monitor-table tr.monitor-entry-paused:hover > td:last-child {
  box-shadow: inset -5px 0 #b91c1c;
}

.monitor-auto-exit-state,
.monitor-auto-exit-state .monitor-entry-progress {
  color: #15803d;
  font-weight: 800;
}

.monitor-take-profit-state {
  color: #0f766e;
  font-weight: 800;
}

.monitor-table tr.monitor-entry-opportunity > td {
  background: #ecfdf5;
  transition: background-color 160ms ease;
}

.monitor-table tr.monitor-entry-opportunity:hover > td {
  background: #dcfce7;
}

/* Primary lifecycle palette. The right edge remains reserved for pause/blocking. */
.monitor-table tr.monitor-row-primary-armed > td { background: #eff6ff; }
.monitor-table tr.monitor-row-primary-armed:hover > td { background: #dbeafe; }
.monitor-table tr.monitor-row-primary-armed > td:first-child { box-shadow: inset 5px 0 #2563eb; }

.monitor-table tr.monitor-row-primary-working > td { background: #fffbeb; }
.monitor-table tr.monitor-row-primary-working:hover > td { background: #fef3c7; }
.monitor-table tr.monitor-row-primary-working > td:first-child { box-shadow: inset 5px 0 #d97706; }

.monitor-table tr.monitor-row-primary-partial > td { background: #fff7ed; }
.monitor-table tr.monitor-row-primary-partial:hover > td { background: #ffedd5; }
.monitor-table tr.monitor-row-primary-partial > td:first-child { box-shadow: inset 5px 0 #ea580c; }

.monitor-table tr.monitor-row-primary-rolling > td { background: #f5f3ff; }
.monitor-table tr.monitor-row-primary-rolling:hover > td { background: #ede9fe; }
.monitor-table tr.monitor-row-primary-rolling > td:first-child { box-shadow: inset 5px 0 #7c3aed; }

.monitor-table tr.monitor-row-primary-take-profit > td { background: #f0fdfa; }
.monitor-table tr.monitor-row-primary-take-profit:hover > td { background: #ccfbf1; }
.monitor-table tr.monitor-row-primary-take-profit > td:first-child { box-shadow: inset 5px 0 #0f766e; }

.monitor-table tr.monitor-row-primary-auto-exit > td { background: #f0fdf4; }
.monitor-table tr.monitor-row-primary-auto-exit:hover > td { background: #dcfce7; }
.monitor-table tr.monitor-row-primary-auto-exit > td:first-child { box-shadow: inset 5px 0 #16a34a; }

.monitor-table tr.monitor-row-primary-position > td { background: #f0fdf4; }
.monitor-table tr.monitor-row-primary-position:hover > td { background: #dcfce7; }
.monitor-table tr.monitor-row-primary-position > td:first-child { box-shadow: inset 5px 0 #22c55e; }

.monitor-table tr.monitor-row-primary-critical > td { background: #fef2f2; }
.monitor-table tr.monitor-row-primary-critical:hover > td { background: #fee2e2; }
.monitor-table tr.monitor-row-primary-critical > td:first-child { box-shadow: inset 5px 0 #dc2626; }

/* A second, layout-neutral stripe marks rows owned by WAITING automation. */
.monitor-table tr.monitor-row-auto-source > td:first-child {
  position: relative;
}
.monitor-table tr.monitor-row-auto-source > td:first-child::after {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 7px;
  width: 3px;
  border-radius: 2px;
  background: #7c3aed;
  pointer-events: none;
}

/* ENTRY WATCH remains a badge; it never supplies a competing row background. */
.monitor-table tr.monitor-row-primary-neutral.monitor-entry-opportunity > td {
  background: #fff;
}
.monitor-table tr.monitor-row-primary-neutral.monitor-entry-opportunity:hover > td {
  background: #f8fafc;
}

.monitor-entry-watch {
  display: block;
  width: max-content;
  margin: 4px 0 0 auto;
  padding: 2px 6px;
  border: 1px solid #6ee7b7;
  border-radius: 999px;
  color: #065f46;
  background: #d1fae5;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.monitor-spark {
  display: block;
  width: 96px;
  height: 24px;
  margin: 3px 0 0 auto;
}

.monitor-spark polyline {
  fill: none;
  stroke: #2563eb;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

/* Keep the compact table summary separate from the expanded payoff chart. */
.monitor-payoff.dc-ff-cell {
  gap: 1px;
  font-variant-numeric: tabular-nums;
}

.monitor-payoff.dc-ff-cell > strong {
  font-size: 11px;
  line-height: 1.25;
}

.monitor-payoff-toggle {
  position: relative;
  display: inline-flex;
  min-width: 0;
  padding: 1px 12px 1px 1px;
  border: 1px solid transparent;
  border-radius: 4px;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: right;
}

.monitor-payoff-toggle:hover,
.monitor-payoff-toggle:focus-visible,
.monitor-payoff-toggle[aria-expanded="true"] {
  border-color: #93c5fd;
  background: rgb(239 246 255 / 82%);
  outline: none;
}

.monitor-payoff-chevron {
  position: absolute;
  top: 4px;
  right: 4px;
  color: #64748b;
  font-size: 8px;
}

.monitor-payoff-chart .profit-zone { fill: #ecfdf5; }
.monitor-payoff-chart .loss-zone { fill: #fff1f2; }
.monitor-payoff-chart .zero-line { stroke: #94a3b8; stroke-width: 1; }
.monitor-payoff-chart .payoff-line {
  fill: none;
  stroke: #2563eb;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.monitor-payoff-chart .payoff-line { stroke-width: 2.5; }
.monitor-payoff-chart .spot-line {
  stroke: #f97316;
  stroke-dasharray: 4 3;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.monitor-payoff-detail > td {
  padding: 0 !important;
  border-top: 0;
  background: #f8fafc !important;
}

.monitor-payoff-profile {
  padding: 14px 18px 12px;
  border-top: 1px solid #bfdbfe;
  border-bottom: 1px solid #bfdbfe;
  text-align: left;
}

.monitor-profile-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.monitor-profile-header > div:first-child > b,
.monitor-profile-header > div:first-child > small {
  display: block;
}

.monitor-profile-header > div:first-child > b {
  color: #0f172a;
  font-size: 13px;
}

.monitor-profile-header > div:first-child > small {
  margin-top: 3px;
  color: #64748b;
  font-size: 10px;
}

.monitor-profile-metrics {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.monitor-profile-metrics > span {
  display: grid;
  min-width: 92px;
  padding: 5px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.monitor-profile-metrics small {
  color: #64748b;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .04em;
}

.monitor-profile-metrics b { font-size: 12px; }
.monitor-profile-metrics em {
  color: #64748b;
  font-size: 9px;
  font-style: normal;
}
.monitor-profile-metrics .profit { border-color: #86efac; color: #15803d; }
.monitor-profile-metrics .loss { border-color: #fda4af; color: #be123c; }
.monitor-profile-metrics .current { border-color: #fdba74; color: #c2410c; }

.monitor-payoff-chart {
  display: block;
  width: 100%;
  max-width: 900px;
  height: auto;
  margin: 10px auto 0;
  overflow: visible;
}

.monitor-payoff-chart .strike-line {
  stroke: #94a3b8;
  stroke-dasharray: 2 4;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.monitor-payoff-chart .strike-label,
.monitor-payoff-chart .breakeven-label,
.monitor-payoff-chart .spot-label,
.monitor-payoff-chart .axis-label {
  fill: #64748b;
  font: 10px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.monitor-payoff-chart .strike-label { fill: #475569; font-weight: 700; }
.monitor-payoff-chart .spot-label { fill: #c2410c; font-weight: 800; }
.monitor-payoff-chart .breakeven-label { fill: #047857; font-size: 9px; }
.monitor-payoff-chart .breakeven-dot { fill: #10b981; stroke: #fff; stroke-width: 1.5; }
.monitor-payoff-chart .spot-dot { fill: #f97316; stroke: #fff; stroke-width: 2; }

.monitor-payoff-profile > p {
  margin: 3px 0 0;
  color: #64748b;
  font-size: 10px;
  line-height: 1.4;
  text-align: center;
}

@media (max-width: 720px) {
  .monitor-profile-header { display: block; }
  .monitor-profile-metrics {
    margin-top: 9px;
    justify-content: flex-start;
  }
  .monitor-profile-metrics > span {
    flex: 1 1 84px;
    text-align: left;
  }
  .monitor-payoff-profile { padding: 12px 10px 10px; }
}

.monitor-state {
  display: inline-block;
  min-width: 55px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
}

.monitor-status-summary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.monitor-status-summary .monitor-age {
  color: var(--muted);
  font-size: 10px;
}

.monitor-state.live { color: #065f46; background: #d1fae5; border-color: #6ee7b7; }
.monitor-state.pending { color: #92400e; background: #fef3c7; border-color: #fcd34d; }
.monitor-state.mixed { color: #5b21b6; background: #ede9fe; border-color: #c4b5fd; }
.monitor-state.stale { color: #991b1b; background: #fee2e2; border-color: #fecaca; }

.monitor-entry-state {
  display: block;
  margin-top: 5px;
  max-width: 180px;
  color: #334155;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
  white-space: normal;
  overflow-wrap: anywhere;
}

.monitor-position-size {
  display: block;
  max-width: 180px;
  margin-top: 4px;
  color: #475569;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}

.monitor-position-size > span {
  display: block;
}

.monitor-position-recovery {
  font-weight: 700;
}

.monitor-structure .monitor-butterfly-strikes {
  max-width: 180px;
  color: #334155;
  font-variant-numeric: tabular-nums;
  white-space: normal;
}

.monitor-entry-events {
  margin: 0;
}

.monitor-entry-events-panel {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  text-align: left;
}

.monitor-entry-events-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 9px;
  border-bottom: 1px solid #e2e8f0;
  color: #334155;
  font-size: 11px;
}
.monitor-entry-events-heading span { color: var(--muted); font-size: 10px; }
.monitor-entry-events-scroll { max-height: 260px; overflow: auto; }
.monitor-entry-events-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 11px;
}
.monitor-entry-events-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 4px 8px;
  border-bottom: 1px solid #cbd5e1;
  background: #f1f5f9;
  color: #475569;
  font-size: 10px;
  font-weight: 700;
  text-align: left;
}
.monitor-entry-events-table td {
  padding: 5px 8px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  vertical-align: top;
  overflow-wrap: anywhere;
}
.monitor-entry-events-table tbody tr:nth-child(even) td { background: #f8fafc; }
.monitor-entry-events-table tbody tr:last-child td { border-bottom: 0; }
.monitor-entry-events-table th:nth-child(1), .monitor-entry-events-table td:nth-child(1) { width: 82px; }
.monitor-entry-events-table th:nth-child(2), .monitor-entry-events-table td:nth-child(2) { width: 290px; white-space: nowrap; }
.monitor-entry-events-table th:nth-child(3), .monitor-entry-events-table td:nth-child(3) { width: 110px; }
.monitor-entry-events-table time { color: #64748b; font-variant-numeric: tabular-nums; }
.monitor-event-actor {
  display: inline-block;
  padding: 1px 5px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  color: #475569;
  background: #f8fafc;
  font-size: 10px;
}
.monitor-entry-events-error { margin-top: 3px; color: #b91c1c; font-size: 10px; }
.monitor-entry-events-loading { color: var(--muted); font-size: 11px; }
.monitor-audit-panel { margin: 8px 10px; }
.monitor-audit-table th:nth-child(1), .monitor-audit-table td:nth-child(1) { width: 120px; }
.monitor-audit-table th:nth-child(2), .monitor-audit-table td:nth-child(2) { width: 210px; white-space: normal; }
.monitor-audit-table th:nth-child(3), .monitor-audit-table td:nth-child(3) { width: 55px; }
.monitor-audit-table th:nth-child(4), .monitor-audit-table td:nth-child(4) { width: 110px; }
.monitor-audit-table th:nth-child(5), .monitor-audit-table td:nth-child(5) { width: 130px; }
.monitor-status-cell.is-clickable { cursor: pointer; }
.monitor-table tr.monitor-entry-events-detail > td {
  padding: 8px 12px 10px;
  background: #f8fafc;
  border-top: 0;
}

.monitor-entry-progress {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  white-space: normal;
}

.monitor-actions {
  width: 279px;
  min-width: 279px;
  white-space: normal;
}

.monitor-action-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 3px;
  margin-bottom: 3px;
}

.monitor-action-fields.has-entry-percentile {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 78px;
}

.monitor-range-filter-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  box-sizing: border-box;
  height: 24px;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
}

.monitor-action-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
}

.monitor-actions input[type="password"],
.monitor-actions input[type="number"],
.monitor-actions select {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 24px;
  margin: 0;
  padding: 3px 5px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  font-size: 11px;
  background: #fff;
}

.monitor-actions .btn2 {
  height: 24px;
  margin: 0;
  padding: 0 6px;
  border-radius: 7px;
  font-size: 11px;
}

.monitor-pin-slot {
  display: inline-flex;
  width: 23px;
  height: 22px;
  flex: 0 0 23px;
}

.monitor-order-controls {
  display: flex;
  gap: 3px;
}

.monitor-structure .monitor-order-controls {
  margin-bottom: 4px;
}

.monitor-structure .monitor-order-button {
  height: 22px;
  min-width: 23px;
  padding: 0 5px;
  border-color: #94a3b8;
  font-weight: 800;
  line-height: 1.1;
}

.monitor-underlying b,
.monitor-spot-note,
.monitor-move {
  display: block;
  font-variant-numeric: tabular-nums;
}

.monitor-spot-note {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.monitor-move {
  width: max-content;
  margin: 4px 0 0 auto;
  padding: 2px 6px;
  border: 1px solid;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.monitor-move.up { color: #9a3412; background: #ffedd5; border-color: #fdba74; }
.monitor-move.down { color: #991b1b; background: #fee2e2; border-color: #fca5a5; }

.dc-favorites-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.dc-favorites-panel > summary {
  cursor: pointer;
  padding: 10px 12px;
  font-size: 13px;
  border-bottom: 1px solid var(--line);
}

.dc-favorites-panel:not([open]) > summary {
  border-bottom: none;
}

.dc-favorites-tablewrap {
  margin-top: 0;
  border: none;
  border-radius: 0 0 12px 12px;
}

.empty-state {
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
}

.info-block {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfbfc;
  color: #1f2937;
  font-size: 13px;
  line-height: 1.5;
}

.info-block h2 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 700;
}

.info-block p {
  margin: 7px 0 0;
  max-width: 1180px;
}

.info-block details {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.info-block summary {
  cursor: pointer;
  font-weight: 700;
}

.info-block h3 {
  margin: 14px 0 6px;
  font-size: 14px;
}

.info-block ul,
.info-block ol {
  margin: 6px 0 0 18px;
  padding: 0;
  max-width: 1180px;
}

.info-block li {
  margin: 4px 0;
}

.monitor-guide .formula-inline {
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #1d4ed8;
}

.monitor-status-docs {
  display: grid;
  grid-template-columns: minmax(130px, 170px) minmax(0, 1fr);
  max-width: 1180px;
  margin: 8px 0 0;
  border-top: 1px solid var(--line);
}

.monitor-status-docs dt,
.monitor-status-docs dd {
  margin: 0;
  padding: 7px 9px;
  border-bottom: 1px solid var(--line);
}

.monitor-status-docs dt {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.monitor-warning {
  padding: 9px 11px;
  border-left: 3px solid #d97706;
  background: #fffbeb;
}

@media (max-width: 700px) {
  .monitor-status-docs { grid-template-columns: 1fr; }
  .monitor-status-docs dt { border-bottom: none; padding-bottom: 0; }
}

.column-docs {
  display: grid;
  grid-template-columns: minmax(88px, 120px) minmax(0, 1fr);
  max-width: 1180px;
  margin: 4px 0 0;
  border-top: 1px solid var(--line);
}
.column-docs dt,
.column-docs dd {
  margin: 0;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}
.column-docs dt {
  font-weight: 700;
  background: #f9fafb;
}
.column-docs dd {
  color: #374151;
}

.info-block .formula {
  display: inline-block;
  margin-top: 4px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

/* === Paper panel (scoped) === */
.screener-panel {
  margin-top: 12px;
  padding: 10px 10px 12px;
  border: 1px solid #e6e6ea;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 1px 10px rgba(0,0,0,0.06);
  overflow-x: auto; /* горизонтальный скролл если таблица широкая */
}

/* Paper uses the same disclosure treatment as Monitor. */
.screener-panel {
  overflow: visible;
  border-color: #bfdbfe;
  box-shadow: none;
}

.screener-panel > summary {
  border-bottom: 1px solid var(--line);
  background: #eff6ff;
  border-radius: 12px 12px 0 0;
}

.screener-panel:not([open]) > summary {
  border-bottom: none;
  border-radius: 12px;
}

.paper-tablewrap {
  margin-top: 0;
  border: none;
  border-radius: 0 0 12px 12px;
}

.screener-panel > summary {
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 14px;
}

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

.screener-panel[open] > summary {
  background: #f7f7fa;
  margin-bottom: 10px;
}

.screener-panel .paperActions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 6px 0 10px;
}

.paperToolbar {
  display: flex;
  align-items: center;
  gap: 10px 16px;
  flex-wrap: wrap;
  margin: 0;
  font-size: 12px;
}

.paperToolbar .schwabImport {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.paperToolbar .schwabImport input {
  width: 160px;
}

.paperStats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin: 0;
  color: #4b5563;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.paperStats b { color: #111827; }
.paperStats sup { margin-left: 2px; cursor: help; }
.paperViewFilters { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.paperViewFilter {
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: #475569;
  cursor: pointer;
  padding: 4px 10px;
}
.paperViewFilter b { margin-left: 4px; color: inherit; }
.paperViewFilter.is-active { border-color: #2563eb; background: #eff6ff; color: #1d4ed8; }

.paperGreeks {
  display: inline-flex;
  flex-wrap: wrap;
  vertical-align: middle;
  gap: 5px;
  margin-left: 10px;
}

.paperGreek {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 3px 7px;
  border: 1px solid #e6e6ea;
  border-radius: 7px;
  background: #fff;
}

.paperGreek > span { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.paperGreek b { font-size: 12px; font-variant-numeric: tabular-nums; }
.paperGreek small { color: var(--muted); font-size: 9px; }
.paperGreek.paperPnl b span { color: inherit; font-size: inherit; font-weight: inherit; text-transform: none; }
.paperGreekStatus { margin-left: 8px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.paperGreekStatus.ok { color: #137333; }
.paperGreekStatus.partial { color: #9a6700; }
.paperGreekStatus.loading { color: #9a6700; }
.paperGreekStatus.unavailable, .paperGreekStatus.disabled { color: #b42318; }
.paperSummaryRefresh { margin-left: 8px; vertical-align: middle; }

@media (max-width: 700px) {
  .paperGreeks { display: flex; margin: 6px 0 0 16px; }
  .paperGreekStatus { display: block; margin: 4px 0 0 16px; }
  .paperSummaryRefresh { margin: 5px 0 0 16px; }
}

/* table */
.screener-panel table.paper {
  width: 100%;
  min-width: 980px; /* чтобы колонки не слипались */
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid #e6e6ea;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.screener-panel table.paper thead th {
  background: #fafafb;
  font-weight: 600;
  font-size: 12px;
  padding: 9px 10px;
  border-bottom: 1px solid #e6e6ea;
  white-space: nowrap;
}

.screener-panel table.paper tbody td {
  font-size: 13px;
  padding: 9px 10px;
  border-bottom: 1px solid #f0f0f3;
  white-space: nowrap;
}
.screener-panel table.paper .paperQtyCol { width: 72px; min-width: 72px; padding-left: 4px; padding-right: 4px; }
.screener-panel .paperQty { box-sizing: border-box; width: 64px; padding: 4px 3px; text-align: center; }
.screener-panel .paperQty::-webkit-inner-spin-button,
.screener-panel .paperQty::-webkit-outer-spin-button { margin: 0; }
.screener-panel .paperTotal { display: block; margin-top: 2px; font-size: 10px; color: inherit; }
.screener-panel .paperFfCurrent { display: block; margin-top: 2px; color: inherit; }
.screener-panel .manualBasis { display: flex; align-items: center; gap: 6px; margin: 8px 0; }
.screener-panel .manualBasis input { width: 120px; padding: 6px 8px; }
.screener-panel .tosCodeHead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.screener-panel .tosCodeRow { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; margin: 5px 0; }
.screener-panel .tosCodeRow code { padding: 8px; overflow-x: auto; font-size: 11px; line-height: 1.45; white-space: nowrap; user-select: text; }

.screener-panel table.paper tbody tr:nth-child(even) {
  background: #fcfcfd;
}

.screener-panel table.paper tbody tr:hover {
  background: #f3f6ff;
}

.screener-panel table.paper tbody tr.paperLiveRow {
  background: #eff6ff;
  box-shadow: inset 4px 0 #2563eb;
}

.screener-panel table.paper tbody tr.paperLiveRow:hover {
  background: #dbeafe;
}

.screener-panel table.paper tbody tr.paperInactiveRow {
  opacity: 0.6;
}
.screener-panel table.paper tbody tr.paperCompletedRow {
  background: #f8fafc;
  opacity: 1;
}
.screener-panel table.paper tbody tr.paperProfitRow:not(.paperLiveRow) { background: #f0fdf4; }
.screener-panel table.paper tbody tr.paperLossRow:not(.paperLiveRow) { background: #fff7ed; }
.screener-panel table.paper tbody tr.paperAttentionRow {
  background: #fef2f2;
  box-shadow: inset 4px 0 #dc2626;
}
.screener-panel table.paper tbody tr.paperGroupRow { background: #f8fafc; }
.screener-panel table.paper tbody tr.paperGroupRow td {
  border-top: 2px solid #cbd5e1;
  color: #334155;
  padding: 6px 10px;
}
.screener-panel table.paper tbody tr.paperGroupREAL td { border-top-color: #2563eb; }
.screener-panel table.paper tbody tr.paperGroupRow span { margin-left: 6px; color: #64748b; font-weight: 400; }

.screener-panel .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.screener-panel td.act {
  text-align: right;
  white-space: nowrap;
}

.screener-panel td.act .btn2 {
  margin-left: 6px;
}
.screener-panel .schwabImport {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}
.screener-panel .schwabImport label { font-size: 12px; font-weight: 700; }
.screener-panel .schwabImport input {
  width: 190px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.screener-panel table.paper { min-width: 1650px; } /* было 980px */

.screener-panel .paperNote {
  width: 260px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 10px;
  background: #fff;
  font-size: 13px;
}

.screener-panel .paperNote:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}

.screener-panel .paperSym {
  max-width: 240px;
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

/* Paper compact toggle + details */
.paperToggleHead { width: 34px; }
.paperToggleCell { width: 34px; text-align: center; }

.paperToggleBtn {
  width: 26px;
  height: 26px;
  border-radius: 9px;
  border: 1px solid #e6e6ea;
  background: #fff;
  cursor: pointer;
  line-height: 24px;
}

.paperToggleBtn:hover { background: #f3f4f6; }

.paperDetailRow td {
  background: #f8fafc;
  border-top: 1px dashed #e6e6ea;
  padding: 12px;
  white-space: normal;
}

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

.paperDetailsGrid .full { grid-column: 1 / -1; }

.paperDetailsGrid .k {
  color: #6b7280;
  margin-right: 8px;
}

.paperDetailsGrid .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
}

.paperAnalysis {
  min-width: 0;
  font-size: 13px;
  color: #1f2937;
  white-space: normal;
}
.paTitle {
  font-weight: 700;
  margin-bottom: 6px;
}
.paLead {
  margin: 0 0 12px;
  max-width: 980px;
  line-height: 1.45;
  color: #374151;
}
.paGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(360px, 1fr));
  gap: 12px;
  align-items: stretch;
}
.paCard {
  min-width: 0;
  max-width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.paSub {
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 6px;
}
.paperAnalysis p {
  margin: 0 0 7px;
  line-height: 1.4;
  color: #374151;
  white-space: normal;
  overflow-wrap: anywhere;
}
.paperAnalysis a,
.paperAnalysis span,
.paperAnalysis div {
  min-width: 0;
}
.paperAnalysis pre {
  margin: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fafb;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.35;
}

.paLinksCard {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.paLinksCard .paSub {
  margin-bottom: 0;
}
.paFfLink {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 9px;
  background: #eff6ff;
  color: #1d4ed8;
  text-decoration: none;
}
.paFfLink:hover {
  border-color: #60a5fa;
  background: #dbeafe;
}
.paFfLink > span:first-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.paFfLink small {
  color: #64748b;
  font-size: 11px;
  font-weight: 500;
}
.paLinkArrow {
  font-size: 18px;
  line-height: 1;
}
.paLinkRow {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}
.paLinkLabel {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.paLinkActions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.paLinkActions .btn2 {
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  color: #374151;
  text-decoration: none;
}

.pnlChart {
  margin-top: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f9fafb;
}
.pnlChart.empty {
  color: var(--muted);
  font-size: 12px;
}
.pnlChartHead,
.pnlChartScale {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}
.pnlChartHead b {
  color: #111827;
  font-variant-numeric: tabular-nums;
}
.pnlChart svg {
  display: block;
  width: 100%;
  height: 120px;
  margin-top: 4px;
}
.pnlChart .zero {
  stroke: #d1d5db;
  stroke-dasharray: 3 4;
  vector-effect: non-scaling-stroke;
}
.pnlChart .sessionBoundary {
  stroke: #cbd5e1;
  stroke-dasharray: 2 4;
  vector-effect: non-scaling-stroke;
}
.pnlChart .line {
  fill: none;
  stroke: #2563eb;
  stroke-width: 2.2;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.pnlChart .last {
  stroke: #2563eb;
  stroke-width: 7;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.realOrderBox {
  border: 1px solid #fecaca;
  background: #fffafa;
}

.liveOrderBox {
  border: 1px solid #fed7aa;
  background: #fff7ed;
}
.realOrderPrice {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
}
.realOrderPrice input,
.realConfirm input {
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 9px;
  background: #fff;
}
.realOrderPrice input {
  width: 90px;
  font-variant-numeric: tabular-nums;
}
.realConfirm {
  margin-top: 8px;
}
.realConfirm summary {
  cursor: pointer;
  color: #991b1b;
  font-weight: 700;
}
.realConfirmBody {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.btn2.danger {
  border-color: #fecaca;
  color: #991b1b;
}

@media (max-width: 980px) {
  .paGrid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 520px) {
  .paLinkRow {
    grid-template-columns: 1fr;
    gap: 5px;
  }
}

.pos { color: #065f46; }
.neg { color: #991b1b; }

/* чтобы таблица paper не раздувалась */
.screener-panel table.paper { min-width: 1100px; }


body[data-page="closed-trades"] .closedTradesTable {
  min-width: 1120px;
}

body[data-page="closed-trades"] .closedMonthOrders {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: baseline;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
body[data-page="closed-trades"] .closedMonthOrders > details,
body[data-page="closed-trades"] .closedMonthOrders > small { width: 100%; }
body[data-page="closed-trades"] .closedMonthDaily { margin-top: 6px; font-variant-numeric: tabular-nums; }

body[data-page="calendar"] .dte-cell { display: inline-flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
body[data-page="calendar"] .dte-cell small { color: var(--ui-muted); font-size: 0.78em; font-weight: 400; white-space: nowrap; }

body[data-page="closed-trades"] .closedStats {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

body[data-page="closed-trades"] .closedStats > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
}

body[data-page="closed-trades"] .closedStats span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

body[data-page="closed-trades"] .closedStats b {
  display: block;
  margin-top: 3px;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

body[data-page="closed-trades"] #closedDailyReportPanel {
  margin-top: 12px;
}

body[data-page="closed-trades"] .closedDailyReportControls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

body[data-page="closed-trades"] #closedDailyReportPanel > .tablewrap {
  padding: 12px;
  background: #fff;
  border: 1px solid var(--ui-border);
  border-top: 0;
  border-radius: 0 0 var(--ui-radius-md) var(--ui-radius-md);
}

body[data-page="closed-trades"] #closedDailyReportText {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

body[data-page="closed-trades"] .closedExpirySummary { margin: 0; padding: 12px 0 0; }
body[data-page="closed-trades"] .closedDailySummary {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
  gap: 12px;
  margin: 0;
  padding: 12px 0 0;
  align-items: start;
}
body[data-page="closed-trades"] #closedDailyChart { display: block; width: 100%; height: 220px; background: #fafafa; border: 1px solid #e5e7eb; }

body[data-page="closed-trades"] .closedDailySummaryTable { margin: 0; }
body[data-page="closed-trades"] .closedDailyBalance { grid-column: 1 / -1; }
body[data-page="closed-trades"] .closedExpiryPanel > .closedExpirySummary,
body[data-page="closed-trades"] .closedDailyPanel > .closedDailySummary,
body[data-page="closed-trades"] .closedTradesPanel > .closedTradesWrap {
  box-sizing: border-box;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--ui-border);
  border-top: 0;
  border-radius: 0 0 var(--ui-radius-md) var(--ui-radius-md);
}
body[data-page="closed-trades"] .closedExpiryPanel > .closedExpirySummary { padding-top: 12px; }

body[data-page="closed-trades"] .closedExpirySummaryGrid {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

body[data-page="closed-trades"] .closedExpirySummaryGrid > div {
  display: flex;
  gap: .75rem;
  align-items: center;
  padding: .45rem .65rem;
  border: 1px solid var(--line, #d1d5db);
  border-radius: .4rem;
}

body[data-page="closed-trades"] .closedOrderRow {
  background: #fff;
}

body[data-page="closed-trades"] .closedOrderRow td {
  font-weight: 600;
  border-top: 2px solid #cbd5e1;
}

body[data-page="closed-trades"] .closedTradeCell {
  width: 13rem;
  max-width: 13rem;
  white-space: normal;
  vertical-align: top;
}

body[data-page="closed-trades"] .closedTradeIds {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 6px;
  line-height: 1.35;
}

body[data-page="closed-trades"] .closedTradeIds span {
  white-space: nowrap;
}

body[data-page="closed-trades"] .closedTradeIdsMore {
  color: var(--muted);
  font-weight: 700;
}

body[data-page="closed-trades"] .closedLegDetailRow td {
  background: #f8fafc;
  font-size: 12px;
  font-weight: 400;
}

body[data-page="closed-trades"] .closedLegFills {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 5px;
  max-width: 18rem;
  line-height: 1.35;
}

body[data-page="closed-trades"] .closedLegFills span {
  white-space: nowrap;
}

body[data-page="closed-trades"] .closedLegFillsMore {
  color: var(--text);
  font-weight: 700;
}

body[data-page="closed-trades"] .closedPositionStatus {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

@media (max-width: 900px) {
  body[data-page="closed-trades"] .closedStats {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
  body[data-page="closed-trades"] .closedDailySummary { grid-template-columns: 1fr; }
}


/* === IVdiff dynamics (vertical) === */
.tbl tr.row { cursor: pointer; }
.tbl tr.row td.act { cursor: default; }

.ivcell { white-space: nowrap; }
.ivdyn {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.15;
  margin-top: 2px;
}

.gexGrid{
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(360px, 1fr);
  gap: 12px;
  padding: 12px 0 0;
  align-items: start;
}

.gexProfileCard {
  grid-column: 1 / -1;
}

.gexProfileCard,
.gexHistoryCard,
.gexLevelsCard {
  min-width: 0;
}

.gexCanvas {
  display: block;
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.gexProfileCanvas {
  height: 440px;
}

.gexHistoryCanvas {
  height: 260px;
}

.gexNote {
  margin-top: 8px;
}

.gexLevelsTableWrap {
  overflow-x: auto;
}

.gexMetaBar {
  min-width: 0;
  flex-wrap: wrap;
  row-gap: 4px;
}

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

  .gexProfileCard {
    grid-column: auto;
  }
}

@media (max-width: 640px){
  body[data-page="dc-time-machine"] .page {
    margin: 10px auto;
    padding: 0 8px;
  }

  body[data-page="dc-time-machine"] .filters {
    gap: 8px;
    padding: 8px;
    align-items: stretch;
  }

  body[data-page="dc-time-machine"] .filters .f {
    min-width: 0;
  }

  body[data-page="dc-time-machine"] .filters .f input[type="number"] {
    width: 68px;
    min-width: 0;
    box-sizing: border-box;
  }

  body[data-page="dc-time-machine"] .filters .f select {
    max-width: 130px;
  }

  body[data-page="dc-time-machine"] #scanBtn {
    flex: 1 0 100%;
    height: 40px;
  }

  body[data-page="dc-time-machine"] .filters .right {
    flex: 1 0 100%;
    margin-left: 0;
    flex-wrap: wrap;
  }

  body[data-page="dc-time-machine"] .dc-scan-tablewrap {
    border-radius: 8px;
    overscroll-behavior-inline: contain;
  }

  body[data-page="dc-time-machine"] .dc-scan-table {
    font-size: 12px;
  }

  body[data-page="dc-time-machine"] .dc-scan-table th,
  body[data-page="dc-time-machine"] .dc-scan-table td {
    padding: 8px 6px;
  }

  .gexMetaBar {
    flex: 1 1 100%;
    max-width: 100%;
    margin-left: 0;
  }

  .gexProfileCanvas {
    height: 360px;
  }

  .gexHistoryCanvas {
    height: 220px;
  }
}

/* === Mobile workflow: Vertical + DC === */
.mobile-sort-bar {
  display: none;
}

@media (max-width: 720px) {
  body[data-page="vertical"],
  body[data-page="dc-time-machine"] {
    overflow-x: hidden;
  }

  body[data-page="vertical"] .page,
  body[data-page="dc-time-machine"] .page {
    box-sizing: border-box;
    width: 100%;
    margin: 10px auto;
    padding: 0 8px;
  }

  body[data-page="vertical"] .filters,
  body[data-page="dc-time-machine"] .filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 8px;
  }

  body[data-page="vertical"] .filters .chip,
  body[data-page="vertical"] .filters .mobile-wide,
  body[data-page="vertical"] .filters .right,
  body[data-page="dc-time-machine"] .filters .chip,
  body[data-page="dc-time-machine"] .filters .mobile-wide,
  body[data-page="dc-time-machine"] .filters .right,
  body[data-page="dc-time-machine"] .filters > #scanBtn {
    grid-column: 1 / -1;
  }

  body[data-page="vertical"] .filters .f,
  body[data-page="dc-time-machine"] .filters .f {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 46px;
    padding: 5px 7px;
  }

  body[data-page="vertical"] .filters .f.mobile-wide,
  body[data-page="dc-time-machine"] .filters .f.mobile-wide {
    justify-content: flex-start;
  }

  body[data-page="vertical"] .filters .f.mobile-wide > input:not([type="checkbox"]),
  body[data-page="vertical"] .filters .f.mobile-wide > select,
  body[data-page="dc-time-machine"] .filters .f.mobile-wide > input:not([type="checkbox"]),
  body[data-page="dc-time-machine"] .filters .f.mobile-wide > select {
    flex: 1 1 auto;
    width: auto;
    max-width: none;
    min-width: 0;
  }

  body[data-page="vertical"] .filters input:not([type="checkbox"]),
  body[data-page="vertical"] .filters select,
  body[data-page="dc-time-machine"] .filters input:not([type="checkbox"]),
  body[data-page="dc-time-machine"] .filters select {
    height: 36px;
    font-size: 16px;
  }

  body[data-page="vertical"] .filters .f input[type="number"],
  body[data-page="dc-time-machine"] .filters .f input[type="number"] {
    width: 68px;
    min-width: 0;
  }

  body[data-page="vertical"] .filters input[type="checkbox"],
  body[data-page="dc-time-machine"] .filters input[type="checkbox"] {
    width: 20px;
    min-width: 20px;
    height: 20px;
  }

  body[data-page="vertical"] .filters > .btn,
  body[data-page="dc-time-machine"] .filters > .btn {
    width: 100%;
    height: 44px;
    font-size: 14px;
  }

  body[data-page="vertical"] .filters .right,
  body[data-page="dc-time-machine"] .filters .right {
    box-sizing: border-box;
    width: 100%;
    min-height: 36px;
    margin-left: 0;
    padding: 4px 2px 0;
    white-space: normal;
  }

  body[data-page="vertical"] .screener-panel,
  body[data-page="dc-time-machine"] .screener-panel {
    padding: 8px;
    overflow: visible;
  }

  body[data-page="calendar"] .screener-panel {
    padding: 8px;
    overflow: visible;
  }

  body[data-page="calendar"] .paper-tablewrap {
    overflow-x: auto;
  }

  body[data-page="vertical"] .screener-panel > summary,
  body[data-page="dc-time-machine"] .screener-panel > summary {
    flex-wrap: wrap;
    padding: 8px;
  }

  body[data-page="dc-time-machine"] .paperGreeks {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    margin: 4px 0 0;
  }

  body[data-page="dc-time-machine"] .paperGreek {
    min-width: 0;
    justify-content: space-between;
  }

  body[data-page="dc-time-machine"] .paperGreekStatus {
    width: calc(100% - 92px);
    margin: 0;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  body[data-page="dc-time-machine"] .paperSummaryRefresh {
    min-width: 80px;
    height: 40px;
    margin: 0 0 0 auto;
  }

  body[data-page="dc-time-machine"] .paperToolbar {
    align-items: stretch;
  }

  body[data-page="dc-time-machine"] .paperToolbar .schwabImport {
    box-sizing: border-box;
    width: 100%;
    padding: 8px;
    flex-wrap: wrap;
  }

  body[data-page="dc-time-machine"] .paperToolbar .schwabImport input {
    flex: 1 1 150px;
    width: auto;
    min-width: 0;
    height: 40px;
    font-size: 16px;
  }

  body[data-page="dc-time-machine"] .paperViewFilters {
    width: 100%;
    padding-bottom: 4px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  body[data-page="dc-time-machine"] .paperViewFilter {
    min-height: 40px;
    flex: 0 0 auto;
  }

  body[data-page="vertical"] .tablewrap,
  body[data-page="dc-time-machine"] .tablewrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
  }

  body[data-page="vertical"] table.mobile-card-table,
  body[data-page="dc-time-machine"] table.mobile-card-table,
  body[data-page="vertical"] .screener-panel table.paper.mobile-card-table,
  body[data-page="dc-time-machine"] .screener-panel table.paper.mobile-card-table {
    display: block;
    width: 100%;
    min-width: 0;
    border: 0;
    overflow: visible;
    background: transparent;
  }

  body[data-page="vertical"] table.mobile-card-table > thead,
  body[data-page="dc-time-machine"] table.mobile-card-table > thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }

  body[data-page="vertical"] table.mobile-card-table > tbody,
  body[data-page="dc-time-machine"] table.mobile-card-table > tbody {
    display: grid;
    gap: 10px;
    width: 100%;
  }

  body[data-page="vertical"] table.mobile-card-table > tbody > tr:not(.expand-row):not(.paperDetailRow):not(.paperGroupRow),
  body[data-page="dc-time-machine"] table.mobile-card-table > tbody > tr:not(.expand-row):not(.paperDetailRow):not(.paperGroupRow) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 4px rgb(15 23 42 / 7%);
    overflow: hidden;
  }

  body[data-page="dc-time-machine"] table.mobile-card-table > tbody > tr.is-normal-iv-setup {
    border-left: 4px solid #10b981;
  }

  body[data-page="dc-time-machine"] table.mobile-card-table > tbody > tr.is-red-iv-setup,
  body[data-page="dc-time-machine"] table.mobile-card-table > tbody > tr.paperAttentionRow {
    border-left: 4px solid #ef4444;
  }

  body[data-page="dc-time-machine"] table.mobile-card-table > tbody > tr.paperLiveRow {
    border-left: 4px solid #2563eb;
  }

  body[data-page="vertical"] table.mobile-card-table td[data-label],
  body[data-page="dc-time-machine"] table.mobile-card-table td[data-label] {
    box-sizing: border-box;
    display: flex;
    min-width: 0;
    min-height: 54px;
    padding: 8px 10px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
    border-right: 0;
    border-bottom: 1px solid #eef0f3;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  body[data-page="vertical"] table.mobile-card-table td[data-label]::before,
  body[data-page="dc-time-machine"] table.mobile-card-table td[data-label]::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: .035em;
    text-transform: uppercase;
  }

  body[data-page="vertical"] table.mobile-card-table td[data-label="#"],
  body[data-page="dc-time-machine"] table.mobile-card-table td[data-label="#"] {
    display: none;
  }

  body[data-page="vertical"] table.mobile-card-table td[data-label="Direction"],
  body[data-page="vertical"] table.mobile-card-table td[data-label="Time"],
  body[data-page="vertical"] table.mobile-card-table td[data-label="Status"],
  body[data-page="vertical"] table.mobile-card-table td[data-label="Note"],
  body[data-page="vertical"] table.mobile-card-table td[data-label="Actions"],
  body[data-page="dc-time-machine"] table.mobile-card-table td[data-label="Time"],
  body[data-page="dc-time-machine"] table.mobile-card-table td[data-label="Structure"],
  body[data-page="dc-time-machine"] table.mobile-card-table td[data-label="Ticker / Structure"],
  body[data-page="dc-time-machine"] table.mobile-card-table td[data-label="Status"],
  body[data-page="dc-time-machine"] table.mobile-card-table td[data-label="Note"],
  body[data-page="dc-time-machine"] table.mobile-card-table td[data-label="Actions"] {
    grid-column: 1 / -1;
  }

  body[data-page="vertical"] table.mobile-card-table td[data-label="Actions"],
  body[data-page="dc-time-machine"] table.mobile-card-table td[data-label="Actions"] {
    min-height: 0;
    padding-top: 10px;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  body[data-page="vertical"] table.mobile-card-table td[data-label="Actions"]::before,
  body[data-page="dc-time-machine"] table.mobile-card-table td[data-label="Actions"]::before {
    flex: 0 0 100%;
  }

  body[data-page="vertical"] table.mobile-card-table td[data-label="Actions"] .btn2,
  body[data-page="dc-time-machine"] table.mobile-card-table td[data-label="Actions"] .btn2 {
    box-sizing: border-box;
    display: inline-flex;
    min-height: 40px;
    margin: 0;
    padding: 0 11px;
    align-items: center;
    justify-content: center;
  }

  body[data-page="vertical"] table.mobile-card-table .dc-ff-cell,
  body[data-page="dc-time-machine"] table.mobile-card-table .dc-ff-cell {
    align-items: flex-start;
  }

  body[data-page="vertical"] table.mobile-card-table tr[hidden],
  body[data-page="dc-time-machine"] table.mobile-card-table tr[hidden] {
    display: none;
  }

  body[data-page="vertical"] table.mobile-card-table .expand-row,
  body[data-page="dc-time-machine"] table.mobile-card-table .paperDetailRow,
  body[data-page="dc-time-machine"] table.mobile-card-table .paperGroupRow {
    display: block;
    width: 100%;
  }

  body[data-page="vertical"] table.mobile-card-table .expand-row > td,
  body[data-page="dc-time-machine"] table.mobile-card-table .paperDetailRow > td,
  body[data-page="dc-time-machine"] table.mobile-card-table .paperGroupRow > td {
    box-sizing: border-box;
    display: block;
    width: 100%;
    border-right: 0;
    white-space: normal;
  }

  body[data-page="vertical"] .expand-grid,
  body[data-page="vertical"] .expand-grid .kv,
  body[data-page="dc-time-machine"] .paperDetailsGrid {
    grid-template-columns: 1fr !important;
  }

  body[data-page="vertical"] .expand-grid .mono,
  body[data-page="dc-time-machine"] .paperDetailsGrid .mono {
    overflow-wrap: anywhere;
  }

  body[data-page="dc-time-machine"] .paperDetailsGrid .full {
    grid-column: auto;
  }

  body[data-page="vertical"] .screener-panel .paperNote,
  body[data-page="dc-time-machine"] .screener-panel .paperNote {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    height: 40px;
    font-size: 16px;
  }

  body[data-page="dc-time-machine"] .screener-panel .paperQty {
    width: 100%;
    min-height: 40px;
    font-size: 16px;
  }

  body[data-page="dc-time-machine"] .monitor-actions {
    width: auto;
    min-width: 0;
  }

  body[data-page="dc-time-machine"] .monitor-action-fields {
    width: 100%;
    gap: 6px;
  }

  body[data-page="dc-time-machine"] .monitor-actions input[type="password"],
  body[data-page="dc-time-machine"] .monitor-actions input[type="number"],
  body[data-page="dc-time-machine"] .monitor-actions select {
    height: 40px;
    font-size: 16px;
  }

  body[data-page="dc-time-machine"] .monitor-range-filter-toggle {
    height: 40px;
    font-size: 16px;
  }

  body[data-page="dc-time-machine"] .monitor-actions .btn2,
  body[data-page="dc-time-machine"] .paperToggleBtn {
    min-width: 40px;
    min-height: 40px;
  }

  body[data-page="dc-time-machine"] .monitor-spark,
  body[data-page="dc-time-machine"] .monitor-entry-watch,
  body[data-page="dc-time-machine"] .monitor-move {
    margin-left: 0;
  }

  body[data-page="dc-time-machine"] .mobile-sort-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f8fafc;
    font-size: 12px;
    font-weight: 700;
  }

  body[data-page="dc-time-machine"] .mobile-sort-bar select {
    box-sizing: border-box;
    flex: 1 1 auto;
    min-width: 0;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 0 8px;
    font-size: 16px;
  }

  body[data-page="vertical"] .info-block,
  body[data-page="dc-time-machine"] .info-block {
    padding: 12px;
    font-size: 14px;
  }
}

/* Keep Paper and Monitor disclosure headers visually consistent. */
.screener-panel[open] > summary {
  margin-bottom: 0;
  background: #eff6ff;
}
