:root {
  color-scheme: light;
  font-family: Inter, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  background: #f3f6fb;
  color: #1f2937;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #f8faff 0%, #f3f6fb 100%);
}

.monitor-shell,
.page-shell {
  width: min(1560px, 96vw);
  margin: 16px auto;
  display: grid;
  gap: 12px;
}

.predict-shell {
  width: min(1280px, 96vw);
  margin: 16px auto;
  display: grid;
  gap: 12px;
}

.ba-monitor-shell {
  width: min(1360px, 96vw);
  margin: 16px auto;
  display: grid;
  gap: 12px;
}

.monitor-shell {
  width: min(1320px, 96vw);
  gap: 8px;
}

.monitor-page-topbar {
  align-items: center;
}

.monitor-page-topbar h1 {
  font-size: 20px;
}

.monitor-page-topbar p {
  font-size: 12px;
}

.card {
  background: #fff;
  border: 1px solid #e4e7ec;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 4px 12px rgba(16, 24, 40, 0.04);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
}

.topbar-actions {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.topbar-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.topbar-shortcut-btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid #175cd3;
  background: linear-gradient(135deg, #175cd3 0%, #1849a9 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(23, 92, 211, 0.18);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.topbar-shortcut-btn:hover {
  color: #fff;
  border-color: #1849a9;
  box-shadow: 0 10px 22px rgba(23, 92, 211, 0.24);
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.predict-topbar {
  align-items: flex-start;
}

.topbar h1 {
  margin: 0;
  font-size: 22px;
}

.topbar p {
  margin: 4px 0 0;
  color: #667085;
  font-size: 13px;
}

.query-form {
  width: min(760px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.query-form-fields {
  display: grid;
  grid-template-columns: minmax(280px, 1.7fr) minmax(180px, 0.9fr);
  gap: 12px;
}

.query-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.query-field-label {
  font-size: 13px;
  font-weight: 600;
  color: #475467;
}

.query-form input {
  width: 100%;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  text-transform: uppercase;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.query-form input:focus {
  outline: none;
  border-color: #175cd3;
  box-shadow: 0 0 0 3px rgba(23, 92, 211, 0.15);
}

.query-form select {
  width: 100%;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  background: #fff;
}

.query-form-actions {
  display: flex;
  align-items: end;
}

.query-form button {
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #175cd3 0%, #1849a9 100%);
  color: #fff;
  min-height: 42px;
  padding: 10px 18px;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
}

.predict-form {
  display: grid;
  grid-template-columns: auto minmax(280px, 360px) auto;
  gap: 8px;
  align-items: center;
}

.predict-form label {
  font-size: 13px;
  color: #475467;
}

.predict-form input {
  min-width: 0;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  text-transform: uppercase;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.predict-form input:focus {
  outline: none;
  border-color: #175cd3;
  box-shadow: 0 0 0 3px rgba(23, 92, 211, 0.15);
}

.predict-form button {
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #175cd3 0%, #1849a9 100%);
  color: #fff;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 600;
}

.ba-monitor-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.ba-summary-item {
  border: 1px solid #eaecf0;
  border-radius: 10px;
  background: #fcfcfd;
  padding: 10px;
  display: grid;
  gap: 4px;
}

.ba-summary-label {
  color: #667085;
  font-size: 12px;
}

.ba-chart-card {
  display: grid;
  gap: 12px;
}

.ba-chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.strategy-share-shell {
  width: min(1120px, 96vw);
}

.strategy-share-summary,
.strategy-share-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

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

.strategy-share-card {
  border: 1px solid #eaecf0;
  border-radius: 12px;
  padding: 14px;
  background: #fcfcfd;
  display: grid;
  gap: 12px;
}

.strategy-share-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.strategy-share-card-title {
  font-size: 16px;
  font-weight: 700;
  color: #101828;
}

.strategy-share-monitor-card {
  gap: 10px;
}

.strategy-share-card-grid-metrics {
  align-items: start;
}

.strategy-share-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.strategy-share-top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.export-share-modal-card {
  width: min(760px, 96vw);
}

.export-share-modal-body {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.export-share-modal-qr-box {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border: 1px solid #eaecf0;
  border-radius: 12px;
  background: #fcfcfd;
}

.export-share-modal-qr-image {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  display: block;
}

.export-share-modal-meta {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.strategy-share-link-input {
  width: 100%;
  min-height: 42px;
  border: 1px solid #d0d5dd;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  color: #344054;
  background: #fff;
}

.export-share-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ba-chart-head-side {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.chart-range-group {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.chart-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.chart-reset-btn {
  white-space: nowrap;
}

.chart-range-btn.is-active {
  border-color: #175cd3;
  color: #175cd3;
  background: #eff4ff;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
}

.chart-legend-item {
  border: 1px solid #d0d5dd;
  border-radius: 999px;
  background: #fff;
  color: #344054;
  padding: 6px 10px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.chart-legend-item:hover {
  border-color: #84adff;
  background: #f8fbff;
}

.chart-legend-item.is-hidden {
  color: #98a2b3;
  background: #f8fafc;
}

.chart-legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.chart-legend-item.is-hidden .chart-legend-swatch {
  opacity: 0.35;
}

.chart-legend-badge {
  border-radius: 999px;
  padding: 1px 6px;
  background: #eef2ff;
  color: #4f46e5;
  font-size: 11px;
  line-height: 1.4;
}

.chart-legend-badge.axis-left {
  background: #eff8ff;
  color: #175cd3;
}

.chart-legend-badge.axis-right {
  background: #fdf2fa;
  color: #c11574;
}

.ba-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(108px, 1fr));
  gap: 8px;
  min-width: min(560px, 100%);
}

.ba-stat {
  border: 1px solid #eaecf0;
  border-radius: 10px;
  background: #f8faff;
  padding: 8px 10px;
  display: grid;
  gap: 4px;
}

.ba-stat-label {
  color: #667085;
  font-size: 12px;
}

.ba-stat-value {
  color: #101828;
  font-size: 14px;
  font-weight: 700;
}

.ba-chart-wrap {
  position: relative;
  border: 1px solid #eaecf0;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

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

.ba-chart-tooltip {
  position: absolute;
  z-index: 5;
  max-width: 280px;
  border: 1px solid #d0d5dd;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.16);
  color: #344054;
  font-size: 12px;
  line-height: 1.55;
  padding: 8px 10px;
  pointer-events: none;
}

.ba-tooltip-title {
  color: #101828;
  font-weight: 700;
  margin-bottom: 4px;
}

.ba-note-table-wrap table,
.ba-note-table {
  min-width: 760px;
}

.status-pill {
  font-size: 13px;
  color: #175cd3;
  background: #eff4ff;
  border: 1px solid #d1e0ff;
  border-radius: 999px;
  padding: 7px 12px;
  display: inline-flex;
  width: fit-content;
}

#progressMeta {
  margin-bottom: 8px;
}

.section-title {
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 700;
}

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

.toggleable-section-head {
  cursor: pointer;
  user-select: none;
}

.toggleable-section-head:focus-visible {
  outline: 3px solid rgba(23, 92, 211, 0.18);
  outline-offset: 4px;
  border-radius: 10px;
}

.inline-actions {
  display: flex;
  gap: 8px;
}

.section-toggle-btn {
  font-weight: 700;
}

.filters-panel {
  display: grid;
  gap: 8px;
}

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

.precious-filters {
  display: grid;
  gap: 10px;
}

.precious-group {
  border: 1px solid #eaecf0;
  border-radius: 10px;
  padding: 8px;
  background: #fcfcfd;
}

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

.precious-group-title {
  font-size: 12px;
  font-weight: 700;
  color: #344054;
}

.precious-group-chart-btn {
  padding: 4px 8px;
  font-size: 12px;
}

.precious-group-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.exchange-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #d0d5dd;
  border-radius: 999px;
  padding: 6px 10px;
  background: #fff;
  color: #344054;
  font-size: 13px;
}

.exchange-option input {
  margin: 0;
}

.ghost-btn {
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #fff;
  color: #344054;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}

.link-btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.ghost-btn:hover {
  border-color: #84adff;
  color: #175cd3;
  background: #f8fbff;
}

.countdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.countdown-label {
  line-height: 1;
}

.countdown-ring {
  --progress: 0deg;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: conic-gradient(#175cd3 var(--progress), #d0d5dd 0deg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.countdown-ring-inner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  color: #667085;
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.countdown-ring.done {
  background: conic-gradient(#175cd3 360deg, #175cd3 360deg);
}

.countdown-ring.done .countdown-ring-inner {
  color: #175cd3;
  font-size: 10px;
}

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

.tab-item {
  display: inline-flex;
  align-items: stretch;
  gap: 6px;
}

.tab-btn {
  border: 1px solid #d0d5dd;
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
  min-width: 130px;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 2px;
}

.tab-main-btn {
  min-width: 130px;
}

.tab-btn:hover {
  border-color: #84adff;
  background: #f8fbff;
}

.tab-btn.active {
  border-color: #175cd3;
  background: #eef4ff;
  box-shadow: inset 0 0 0 1px rgba(23, 92, 211, 0.15);
}

.tab-title {
  font-size: 13px;
  font-weight: 700;
  color: #194185;
}

.tab-meta {
  font-size: 12px;
}

.tab-inline-actions {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  justify-content: center;
}

.tab-action-btn {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #344054;
  padding: 0;
  font-size: 12px;
  cursor: pointer;
  min-height: 0;
}

.tab-action-btn.icon-btn {
  width: 20px;
  min-width: 20px;
  min-height: 20px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
}

.tab-action-btn:hover {
  border-color: transparent;
  color: #175cd3;
  background: transparent;
}

.tab-action-btn.danger {
  color: #b42318;
}

.cell-link {
  border: 0;
  background: transparent;
  color: #175cd3;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.cell-link:hover {
  color: #1849a9;
}

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

.action-stack {
  display: inline-grid;
  gap: 4px;
  justify-items: center;
}

.progress-toggle-btn {
  font-size: 14px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 10px;
  border-color: #84adff;
  background: #eef4ff;
  color: #175cd3;
}

.progress-toggle-btn:hover {
  border-color: #175cd3;
  background: #dbe8ff;
}

.table-wrap {
  overflow: auto;
  border: 1px solid #eaecf0;
  border-radius: 10px;
  background: #fff;
}

table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  min-width: 1100px;
  font-size: 13px;
}

thead th {
  background: #f8faff;
  border-bottom: 1px solid #e4e7ec;
  color: #344054;
  font-weight: 700;
  padding: 10px 10px;
  text-align: left;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}

th.sortable {
  cursor: pointer;
  user-select: none;
}

th.sortable:hover {
  color: #175cd3;
}

.sort-indicator {
  font-size: 12px;
  color: #98a2b3;
  margin-left: 4px;
}

td.has-tooltip {
  cursor: help;
}

tbody td {
  border-bottom: 1px solid #f2f4f7;
  padding: 9px 10px;
  white-space: nowrap;
}

.results-table .col-pair {
  width: 280px;
  max-width: 280px;
}

.results-table .col-position {
  width: 320px;
  max-width: 320px;
}

.wrap-cell {
  display: block;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.45;
}

.results-table .pair-cell {
  max-width: 280px;
}

.results-table .position-cell {
  max-width: 320px;
}

tbody tr:nth-child(even) {
  background: #fcfdff;
}

tbody tr:hover {
  background: #eef4ff;
}

th.sticky-col {
  position: sticky;
  left: 0;
  z-index: 3;
  background: #f8faff;
  box-shadow: 1px 0 0 #e4e7ec;
}

td.sticky-col {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #fff;
  box-shadow: 1px 0 0 #eef2f7;
}

tbody tr:nth-child(even) td.sticky-col {
  background: #fcfdff;
}

tbody tr:hover td.sticky-col {
  background: #eef4ff;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 50;
}

.modal-overlay.hidden {
  display: none;
}

.modal-card {
  width: min(980px, 96vw);
  max-height: 82vh;
  background: #fff;
  border: 1px solid #e4e7ec;
  border-radius: 12px;
  box-shadow: 0 20px 36px rgba(16, 24, 40, 0.2);
  display: grid;
  gap: 8px;
  padding: 12px;
}

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

.modal-title {
  font-weight: 700;
  color: #101828;
}

.execution-reason-modal-card {
  width: min(720px, 96vw);
}

.execution-reason-body {
  color: #344054;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 2px 2px 4px;
}

.modal-table-wrap {
  max-height: 62vh;
}

.algo-notes {
  color: #344054;
  font-size: 13px;
  line-height: 1.65;
}

.algo-notes ol {
  margin: 0;
  padding-left: 18px;
}

.algo-notes code {
  background: #f2f4f7;
  border: 1px solid #e4e7ec;
  border-radius: 6px;
  padding: 1px 5px;
  font-size: 12px;
}

.portfolio-summary {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.portfolio-categories {
  display: grid;
  gap: 14px;
}

.portfolio-category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.portfolio-category-card {
  border: 1px solid #e4e7ec;
  border-radius: 12px;
  background: #fcfcfd;
  padding: 12px;
  display: grid;
  gap: 12px;
}

.portfolio-category-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.portfolio-category-title {
  font-size: 15px;
  font-weight: 700;
  color: #101828;
}

.portfolio-category-desc {
  color: #667085;
  font-size: 12px;
  margin-top: 4px;
}

.portfolio-empty {
  color: #667085;
  font-size: 13px;
}

.portfolio-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.portfolio-metric {
  border: 1px solid #e4e7ec;
  border-radius: 12px;
  background: #f8fbff;
  padding: 10px 12px;
  display: grid;
  gap: 4px;
}

.portfolio-metric-label {
  font-size: 12px;
  color: #475467;
}

.portfolio-metric-value {
  font-size: 18px;
  font-weight: 700;
  color: #194185;
}

.portfolio-notes {
  display: grid;
  gap: 8px;
  font-size: 13px;
  color: #344054;
}

.exchange-badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.exchange-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #d1e0ff;
  background: #eef4ff;
  color: #194185;
  font-size: 12px;
  font-weight: 600;
}

.fee-input {
  width: 110px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 13px;
  text-align: right;
}

.fee-input:focus {
  outline: none;
  border-color: #175cd3;
  box-shadow: 0 0 0 3px rgba(23, 92, 211, 0.15);
}

.right {
  text-align: right;
}

.center {
  text-align: center;
}

.tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  background: #eef4ff;
  color: #194185;
  font-size: 12px;
  border: 1px solid #d1e0ff;
}

.status-chip {
  display: inline-block;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border: 1px solid transparent;
}

button.status-chip {
  cursor: pointer;
}

.execution-reason-btn {
  background-clip: padding-box;
}

.execution-reason-btn:hover {
  filter: brightness(0.98);
  box-shadow: 0 0 0 2px rgba(23, 92, 211, 0.08);
}

.status-chip-pending {
  color: #475467;
  background: #f2f4f7;
  border-color: #e4e7ec;
}

.status-chip-loading {
  color: #b54708;
  background: #fff4ed;
  border-color: #ffd6ae;
}

.status-chip-done {
  color: #067647;
  background: #ecfdf3;
  border-color: #abefc6;
}

.status-chip-error {
  color: #b42318;
  background: #fef3f2;
  border-color: #fecdca;
}

.good {
  color: #067647;
  font-weight: 600;
}

.warn {
  color: #b54708;
  font-weight: 600;
}

.bad {
  color: #b42318;
  font-weight: 600;
}

.muted {
  color: #667085;
}

.row-ok {
  color: #067647;
}

.row-error {
  color: #b42318;
}

.monitor-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.monitor-cards.monitor-cards-compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.predict-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
  align-items: start;
}

.predict-card {
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  background: #fff;
  padding: 12px 14px;
  display: grid;
  gap: 12px;
  box-shadow: 0 3px 10px rgba(16, 24, 40, 0.04);
  min-width: 0;
  overflow: hidden;
  align-self: start;
}

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

.predict-title {
  font-size: 18px;
  font-weight: 800;
  color: #101828;
}

.predict-subtitle {
  margin-top: 4px;
  color: #667085;
  font-size: 12px;
}

.predict-metrics-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}

.predict-metric {
  border: 1px solid #eaecf0;
  border-radius: 10px;
  background: #fcfcfd;
  padding: 10px 12px;
  min-width: 0;
  align-self: start;
}

.predict-metric-label {
  font-size: 12px;
  color: #667085;
}

.predict-metric-value {
  margin-top: 4px;
  font-size: 18px;
  font-weight: 800;
  color: #101828;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.predict-metric-meta {
  margin-top: 4px;
  color: #667085;
  font-size: 12px;
}

.ba-stat-meta {
  margin-top: 4px;
  color: #667085;
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.predict-note-list {
  margin: 0;
  padding-left: 18px;
  color: #344054;
  font-size: 13px;
  line-height: 1.6;
}

.predict-table-wrap {
  overflow-x: auto;
}

.predict-table {
  min-width: 0;
  width: 100%;
  table-layout: fixed;
}

.predict-table th,
.predict-table td {
  white-space: nowrap;
}

.monitor-card {
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  background: #fff;
  padding: 10px 12px;
  display: grid;
  gap: 8px;
  box-shadow: 0 3px 10px rgba(16, 24, 40, 0.04);
}

.monitor-card.dragging {
  opacity: 0.55;
  border-style: dashed;
}

.monitor-card.drag-over-before {
  box-shadow: inset 0 3px 0 #175cd3;
}

.monitor-card.drag-over-after {
  box-shadow: inset 0 -3px 0 #175cd3;
}

.monitor-card.monitor-card-compact {
  padding: 8px 10px;
  gap: 6px;
}

.monitor-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.monitor-card-title {
  font-size: 18px;
  font-weight: 800;
  color: #101828;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.monitor-card-subtitle {
  margin-top: 3px;
  color: #475467;
  font-size: 12px;
}

.compact-btn {
  min-width: 36px;
  min-height: 32px;
  padding: 4px 10px;
  border-radius: 10px;
  font-size: 12px;
}

.danger-btn {
  color: #b42318;
}

.monitor-metrics-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.monitor-metric {
  min-width: 0;
}

.monitor-metric-label {
  color: #475467;
  font-size: 12px;
  margin-bottom: 4px;
}

.monitor-metric-value {
  color: #101828;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  white-space: normal;
  overflow-wrap: anywhere;
}

.monitor-metric-value.negative {
  color: #b42318;
}

.monitor-metric-meta {
  margin-top: 3px;
  color: #667085;
  font-size: 12px;
}

.monitor-metric-submeta {
  margin-top: 3px;
  color: #475467;
  font-size: 12px;
}

.monitor-metric-submeta.positive {
  color: #067647;
  font-weight: 600;
}

.monitor-metric-submeta.warn {
  color: #b54708;
  font-weight: 600;
}

.monitor-metric-submeta.negative {
  color: #b42318;
  font-weight: 600;
}

.monitor-source-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.monitor-source-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid #d0d5dd;
  border-radius: 999px;
  background: #f8faff;
  color: #344054;
  font-size: 12px;
  padding: 2px 8px;
}

.monitor-source-chip.positive {
  color: #067647;
  border-color: #abefc6;
  background: #ecfdf3;
}

.monitor-source-chip.warn {
  color: #b54708;
  border-color: #ffd6ae;
  background: #fff4ed;
}

.monitor-source-chip.negative {
  color: #b42318;
  border-color: #fecdca;
  background: #fef3f2;
}

.monitor-compact-refresh {
  font-size: 12px;
  color: #667085;
  padding-top: 4px;
  border-top: 1px dashed #eaecf0;
}

.monitor-editor {
  gap: 10px;
}

.compact-leg {
  padding: 8px;
  gap: 7px;
}

.macro-overview-card {
  display: grid;
  gap: 8px;
}

.macro-add-form {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr)) auto;
  gap: 8px;
  align-items: center;
}

.macro-add-form input,
.macro-add-form select {
  width: 100%;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  background: #fff;
}

.macro-add-form input:focus,
.macro-add-form select:focus {
  outline: none;
  border-color: #175cd3;
  box-shadow: 0 0 0 3px rgba(23, 92, 211, 0.14);
}

.macro-add-form button {
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #175cd3 0%, #1849a9 100%);
  color: #fff;
  min-height: 36px;
  padding: 8px 12px;
  font-weight: 700;
  cursor: pointer;
}

.macro-row-group {
  display: grid;
  gap: 5px;
}

.macro-row-title {
  font-size: 12px;
  font-weight: 700;
  color: #344054;
}

.macro-quote-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 6px;
}

.macro-row-group-eternal .macro-quote-row {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  justify-content: center;
}

.macro-row-group-macro .macro-quote-row {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.macro-quote-row-custom {
  min-height: 128px;
  align-content: flex-start;
}

.macro-quote-row-custom.is-empty {
  min-height: 0;
}

.macro-custom-empty {
  padding: 6px 10px;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-radius: 8px;
}

.macro-quote-card {
  border: 1px solid #e4e7ec;
  border-radius: 10px;
  background: #fcfdff;
  padding: 6px 8px;
  display: grid;
  gap: 3px;
  min-height: 78px;
}

.macro-quote-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
}

.macro-quote-name {
  font-size: 11px;
  font-weight: 700;
  color: #344054;
}

.macro-quote-line {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
}

.macro-quote-value {
  font-size: 16px;
  font-weight: 800;
  color: #101828;
  line-height: 1.1;
  word-break: break-word;
}

.macro-quote-unit-inline,
.macro-quote-change,
.macro-quote-premium {
  font-size: 11px;
  color: #667085;
}

.macro-quote-change.up {
  color: #067647;
  font-weight: 700;
}

.macro-quote-change.down {
  color: #b42318;
  font-weight: 700;
}

.macro-quote-premium.premium-red {
  color: #b42318;
  font-weight: 700;
}

.macro-quote-premium.premium-green {
  color: #067647;
  font-weight: 700;
}

.macro-quote-error {
  font-size: 11px;
  color: #b42318;
  white-space: normal;
  overflow-wrap: anywhere;
}

.macro-remove-btn {
  padding: 1px 6px;
  min-height: 18px;
  line-height: 1;
}

.strategy-monitor-card {
  display: grid;
  gap: 8px;
}

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

.strategy-empty {
  border: 1px dashed #d0d5dd;
  border-radius: 12px;
  padding: 18px;
  background: #fcfcfd;
}

.strategy-card {
  border: 1px solid #e4e7ec;
  border-radius: 12px;
  padding: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  display: grid;
  gap: 12px;
}

.strategy-card-dragging {
  opacity: 0.55;
}

.strategy-card-drop-before {
  box-shadow: inset 0 3px 0 #175cd3;
}

.strategy-card-drop-after {
  box-shadow: inset 0 -3px 0 #175cd3;
}

.strategy-card-draft {
  border-style: dashed;
}

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

.strategy-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #101828;
}

.strategy-card-subtitle {
  margin-top: 4px;
  font-size: 15px;
  font-weight: 700;
  color: #194185;
  line-height: 1.45;
}

.strategy-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.strategy-card [data-action="drag-handle"] {
  cursor: grab;
}

.strategy-card [data-action="drag-handle"]:active {
  cursor: grabbing;
}

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

.strategy-leg {
  border: 1px solid #eaecf0;
  border-radius: 10px;
  padding: 12px;
  background: #fff;
  display: grid;
  gap: 10px;
}

.strategy-leg-title {
  font-size: 13px;
  font-weight: 700;
  color: #194185;
}

.strategy-field {
  display: grid;
  gap: 6px;
}

.strategy-field label {
  font-size: 12px;
  color: #475467;
}

.strategy-field input,
.strategy-field select {
  width: 100%;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 13px;
  background: #fff;
}

.strategy-field input {
  text-transform: uppercase;
}

.strategy-field input:focus,
.strategy-field select:focus {
  outline: none;
  border-color: #175cd3;
  box-shadow: 0 0 0 3px rgba(23, 92, 211, 0.15);
}

.strategy-search-meta {
  font-size: 12px;
  color: #667085;
  min-height: 18px;
}

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

.strategy-metric {
  border: 1px solid #eaecf0;
  border-radius: 10px;
  background: #fff;
  padding: 10px 12px;
}

.strategy-metric-label {
  font-size: 11px;
  color: #667085;
  margin-bottom: 4px;
}

.strategy-metric-value {
  font-size: 16px;
  font-weight: 700;
  color: #101828;
  line-height: 1.35;
  word-break: break-word;
}

.strategy-metric-value.negative {
  color: #b42318;
}

.strategy-monitor-error {
  border: 1px solid #fecdca;
  background: #fef3f2;
  color: #b42318;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.ranking-shell {
  width: min(1800px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.ranking-compact-topbar {
  padding: 12px 14px;
  align-items: center;
  gap: 12px;
}

.ranking-compact-topbar h1 {
  font-size: 20px;
  line-height: 1.2;
  margin-bottom: 2px;
}

.ranking-compact-topbar p {
  font-size: 13px;
  line-height: 1.25;
  margin: 0;
}

.ranking-compact-topbar .topbar-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  overflow-x: auto;
  max-width: 100%;
}

.ranking-compact-topbar .ghost-btn,
.ranking-compact-topbar button,
.ranking-compact-topbar .link-btn {
  padding: 7px 10px;
  font-size: 13px;
  white-space: nowrap;
  flex: 0 0 auto;
}

.ranking-status-card {
  display: grid;
  gap: 8px;
}

.ranking-meta {
  font-size: 13px;
}

.ranking-summary-grid {
  display: grid;
  grid-template-columns: minmax(420px, 2.1fr) repeat(3, minmax(130px, 1fr));
  gap: 8px;
  align-items: stretch;
}

.ranking-summary-item {
  border: 1px solid #eaecf0;
  background: #fcfcfd;
  border-radius: 10px;
  padding: 8px 10px;
}

.ranking-summary-label {
  color: #667085;
  font-size: 11px;
  margin-bottom: 4px;
}

.ranking-summary-value {
  color: #101828;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.ranking-threshold-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(82px, 1fr)) auto;
  gap: 6px;
  align-items: end;
}

.ranking-threshold-form label {
  display: grid;
  grid-template-columns: 1fr 52px auto;
  align-items: center;
  gap: 4px;
  color: #101828;
  font-size: 11px;
  font-weight: 700;
}

.ranking-threshold-form input {
  width: 100%;
  min-width: 0;
  padding: 5px 6px;
  border: 1px solid #d0d5dd;
  border-radius: 7px;
  font-size: 12px;
}

.ranking-threshold-form button {
  justify-self: start;
}

.ranking-table-wrap {
  max-height: calc(100vh - 310px);
}

.ranking-table {
  min-width: 1480px;
}

.ranking-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f9fafb;
}

.ranking-sort-btn {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.ranking-sort-btn:hover {
  color: #175cd3;
}

.ranking-small-muted {
  color: #667085;
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.ranking-inline-link {
  color: #175cd3;
  text-decoration: none;
}

.ranking-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 14px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.ranking-token-info-inline {
  margin-top: 2px;
}

.ranking-inline-link:hover {
  text-decoration: underline;
}

.ranking-error {
  color: #b42318;
}

.ranking-potential-row td {
  background: #fff8e6;
}

.ranking-potential-row:hover td {
  background: #fff3c4;
}

.ranking-ignored-row td {
  opacity: 0.72;
}

.ranking-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  margin: 1px 2px 1px 0;
}

.ranking-badge.danger {
  background: #fef3f2;
  color: #b42318;
  border: 1px solid #fecdca;
}

.ranking-badge.neutral {
  background: #f2f4f7;
  color: #344054;
  border: 1px solid #eaecf0;
}

.ranking-badge.muted-badge {
  background: #eff4ff;
  color: #175cd3;
  border: 1px solid #d1e0ff;
}

.ranking-ignore-btn {
  white-space: nowrap;
}

.ranking-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.ranking-curve-btn {
  white-space: nowrap;
  text-decoration: none;
}

.ranking-telegram-off {
  color: #b42318;
  border-color: #fecdca;
  background: #fef3f2;
}

.positive-text {
  color: #067647;
  font-weight: 700;
}

.negative-text {
  color: #b42318;
  font-weight: 700;
}

@media (max-width: 1200px) {
  .monitor-cards {
    grid-template-columns: 1fr;
  }

  .predict-grid {
    grid-template-columns: 1fr;
  }

  .strategy-cards {
    grid-template-columns: 1fr;
  }

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

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

  .ranking-threshold-form {
    grid-template-columns: repeat(2, minmax(120px, 1fr)) auto;
  }
}

@media (max-width: 980px) {
  .topbar-actions {
    width: 100%;
    justify-items: stretch;
  }

  .topbar-shortcuts {
    width: 100%;
    justify-content: stretch;
  }

  .topbar-shortcut-btn {
    flex: 1 1 220px;
  }

  .query-form {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .query-form-fields {
    grid-template-columns: 1fr;
  }

  .query-form-actions {
    width: 100%;
  }

  .query-form button {
    width: 100%;
  }

  .predict-form {
    grid-template-columns: 1fr;
  }

  .macro-add-form {
    grid-template-columns: 1fr;
  }

  .macro-quote-row {
    grid-template-columns: 1fr;
  }

  .macro-row-group-eternal .macro-quote-row,
  .macro-row-group-macro .macro-quote-row {
    grid-template-columns: 1fr;
  }

  .macro-quote-row-custom {
    min-height: 0;
  }

  .monitor-metrics-row,
  .ba-monitor-summary,
  .ranking-summary-grid,
  .predict-metrics-row,
  .strategy-form-grid,
  .strategy-monitor-grid {
    grid-template-columns: 1fr;
  }

  .ranking-threshold-form {
    grid-template-columns: 1fr;
  }

  .ba-chart-head {
    flex-direction: column;
  }

  .ba-chart-head-side,
  .chart-range-group {
    width: 100%;
    justify-items: stretch;
    justify-content: flex-start;
  }

  .ba-stats-grid {
    width: 100%;
    min-width: 0;
    grid-template-columns: 1fr;
  }

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

  .monitor-card-title {
    font-size: 18px;
  }

  .monitor-metric-value {
    font-size: 17px;
  }
}

.strategy-open-record-panel {
  border: 1px solid #eaecf0;
  border-radius: 12px;
  background: #f8faff;
  padding: 10px;
  display: grid;
  gap: 10px;
}

.strategy-open-record-grid {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(120px, 0.6fr) minmax(160px, 1fr);
  gap: 10px;
}

.strategy-open-record-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.strategy-history-shell {
  width: min(1420px, 96vw);
}

.strategy-history-records-card {
  display: grid;
  gap: 10px;
}

.strategy-history-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.strategy-history-list-item {
  width: 100%;
  border: 1px solid #eaecf0;
  border-radius: 10px;
  background: #fff;
  padding: 10px;
  text-align: left;
  display: grid;
  gap: 4px;
  color: #344054;
  cursor: pointer;
}

.strategy-history-list-item:hover,
.strategy-history-list-item.active {
  border-color: #175cd3;
  background: #eff4ff;
}

.strategy-history-list-item span {
  color: #667085;
  font-size: 12px;
}

.strategy-history-list-item.dragging {
  opacity: 0.55;
  border-style: dashed;
}

.strategy-history-main {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.strategy-history-main-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.strategy-history-title-block {
  display: grid;
  gap: 8px;
  min-width: 0;
}

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

.strategy-history-qty-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  min-width: 0;
}

.strategy-history-qty-box label {
  color: #667085;
  font-size: 12px;
  text-align: right;
}

.strategy-history-qty-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

.strategy-history-qty-box input {
  min-height: 38px;
  border: 1px solid #d0d5dd;
  border-radius: 10px;
  padding: 8px 10px;
  width: 160px;
}

.strategy-history-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 8px;
}

.strategy-history-archive-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.strategy-history-archive-card {
  border: 1px solid #eaecf0;
  border-radius: 10px;
  background: #fff;
  padding: 10px;
  display: grid;
  gap: 6px;
}

.strategy-history-archive-title {
  font-size: 14px;
  font-weight: 700;
  color: #101828;
  line-height: 1.25;
}

.strategy-history-archive-meta {
  color: #667085;
  font-size: 12px;
  line-height: 1.4;
}

.strategy-history-archive-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
}

.strategy-history-archive-metric {
  min-width: 0;
}

.strategy-history-archive-label {
  color: #667085;
  font-size: 11px;
}

.strategy-history-archive-value {
  margin-top: 2px;
  color: #101828;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.strategy-history-archive-value.negative {
  color: #b42318;
}

.strategy-history-archive-value.positive {
  color: #067647;
}

.strategy-history-debug-card {
  display: grid;
  gap: 10px;
}

.strategy-history-debug-head {
  border: 0;
  background: transparent;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  text-align: left;
}

.strategy-history-debug-body {
  display: grid;
  gap: 10px;
}

.strategy-history-debug-summary {
  font-size: 12px;
}

.strategy-history-debug-table-wrap {
  overflow: auto;
  border: 1px solid #eaecf0;
  border-radius: 10px;
  background: #fff;
}

.strategy-history-debug-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.strategy-history-debug-table th,
.strategy-history-debug-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #eaecf0;
  text-align: right;
  white-space: nowrap;
}

.strategy-history-debug-table th:first-child,
.strategy-history-debug-table td:first-child {
  text-align: left;
}

.strategy-history-debug-table tbody tr:hover {
  background: #f8fafc;
}

@media (max-width: 900px) {
  .strategy-open-record-grid,
  .strategy-history-summary {
    grid-template-columns: 1fr;
  }

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

  .strategy-history-archive-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .strategy-history-main-head {
    grid-template-columns: 1fr;
  }

  .strategy-history-actions,
  .strategy-history-qty-box,
  .strategy-history-qty-box label {
    justify-content: flex-start;
    text-align: left;
  }

  .strategy-history-qty-box {
    align-items: flex-start;
  }

  .strategy-history-qty-controls {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .monitor-page-topbar {
    gap: 12px;
  }

  .monitor-page-topbar .link-btn {
    width: 100%;
    justify-content: center;
  }

  .strategy-share-mobile-shell {
    width: min(100vw, 100%);
    margin: 10px auto 16px;
    gap: 10px;
  }

  .strategy-share-top-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .strategy-share-summary,
  .strategy-share-card-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .export-share-modal-body {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .export-share-modal-qr-box {
    padding: 10px;
  }

  .export-share-modal-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .export-share-modal-actions > * {
    width: 100%;
    justify-content: center;
  }

  .strategy-share-card {
    padding: 12px;
    border-radius: 12px;
    gap: 10px;
  }

  .strategy-share-card-head {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .strategy-share-card-head .link-btn,
  .strategy-share-card-head .ghost-btn {
    width: 100%;
    justify-content: center;
  }

  .strategy-share-card-title {
    font-size: 15px;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }

  .strategy-share-meta-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .strategy-monitor-card > .section-head,
  .macro-overview-card > .section-head {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .strategy-monitor-card > .section-head .inline-actions,
  .macro-overview-card > .section-head .inline-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .strategy-monitor-card > .section-head .inline-actions > *,
  .macro-overview-card > .section-head .inline-actions > * {
    width: 100%;
    justify-content: center;
  }

  .monitor-cards {
    gap: 12px;
  }

  .monitor-card,
  .monitor-card.monitor-card-compact {
    padding: 10px;
    border-radius: 12px;
  }

  .monitor-card-head {
    gap: 10px;
  }

  .monitor-card-head .inline-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
  }

  .monitor-card-head .inline-actions .compact-btn {
    width: 100%;
    min-width: 0;
    padding-left: 8px;
    padding-right: 8px;
  }

  .monitor-card-title {
    font-size: 16px;
    line-height: 1.2;
    overflow-wrap: anywhere;
  }

  .monitor-metric {
    padding: 8px 0;
  }

  .monitor-metric-value {
    font-size: 16px;
  }

  .monitor-metric-meta,
  .monitor-metric-submeta {
    font-size: 11px;
    line-height: 1.45;
  }

  .monitor-source-row {
    gap: 6px;
  }

  .monitor-source-chip {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .strategy-leg,
  .strategy-open-record-panel {
    padding: 10px;
  }

  .strategy-field input,
  .strategy-field select {
    min-height: 40px;
    font-size: 16px;
  }

  .strategy-open-record-actions,
  .strategy-open-record-actions .inline-actions {
    grid-template-columns: 1fr;
  }

  .strategy-open-record-actions .inline-actions > * {
    width: 100%;
    justify-content: center;
  }

  .macro-add-form button,
  .ghost-btn,
  .link-btn {
    min-height: 40px;
  }

  .strategy-history-list {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .strategy-history-archive-list {
    grid-template-columns: 1fr;
  }

  .strategy-history-shell {
    width: min(100vw, 100%);
    margin: 10px auto 16px;
    gap: 10px;
  }

  .strategy-history-records-card,
  .strategy-history-main,
  .ba-chart-card,
  .strategy-history-debug-card {
    gap: 8px;
  }

  .strategy-history-list-item {
    padding: 12px;
    gap: 6px;
    border-radius: 12px;
  }

  .strategy-history-list-item strong {
    font-size: 14px;
    line-height: 1.35;
  }

  .strategy-history-list-item span {
    font-size: 12px;
    line-height: 1.45;
  }

  .strategy-history-title-block {
    gap: 6px;
  }

  .strategy-history-actions {
    width: 100%;
  }

  .strategy-history-qty-box {
    width: 100%;
    padding: 10px;
    border: 1px solid #eaecf0;
    border-radius: 12px;
    background: #fcfcfd;
    align-items: stretch;
  }

  .strategy-history-qty-controls {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }

  .strategy-history-qty-box input,
  .strategy-history-qty-controls > * {
    width: 100%;
  }

  .strategy-history-summary {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .strategy-history-archive-card {
    padding: 12px;
    border-radius: 12px;
  }

  .strategy-history-archive-metrics {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .ba-chart-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .ba-chart-head-side,
  .chart-toolbar,
  .chart-range-group {
    width: 100%;
  }

  .chart-toolbar {
    display: grid;
    gap: 8px;
  }

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

  .chart-range-group > *,
  .chart-reset-btn {
    width: 100%;
    justify-content: center;
  }

  .ba-stats-grid,
  #dailyStats,
  #cumulativeStats {
    grid-template-columns: 1fr;
  }
}
