.rm-page {
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
  overflow-y: auto;
  padding: 24px 28px 44px;
  color: var(--text-primary, #1d2733);
}
.rm-header { margin-bottom: 18px; }
.rm-eyebrow { color: #1d7a68; font-size: 11px; font-weight: 700; }
.rm-header h2 { margin: 4px 0; font-size: 25px; line-height: 1.2; }
.rm-header p { margin: 0; color: var(--text-secondary, #64748b); font-size: 13px; }
.rm-control-panel, .rm-panel {
  background: #fff;
  border: 1px solid var(--border-lighter, #e4e9ee);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(30, 52, 68, .05);
}
.rm-control-panel { padding: 16px; margin-bottom: 16px; }
.rm-quick-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.6fr) minmax(170px, .8fr) auto;
  gap: 12px;
  align-items: end;
}
.rm-quick-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-secondary, #64748b);
  font-size: 12px;
  font-weight: 600;
}
.rm-quick-grid input, .rm-quick-grid select, .rm-market-heading select {
  min-height: 34px;
  border: 1px solid #d7e0e7;
  border-radius: 5px;
  padding: 0 9px;
  color: var(--text-primary, #1d2733);
  background: #fff;
  font: inherit;
  font-weight: 400;
}
.rm-quick-grid input:focus, .rm-quick-grid select:focus, .rm-market-heading select:focus {
  border-color: #1d7a68;
  outline: 2px solid rgba(29, 122, 104, .12);
}
.rm-quick-grid .btn-sm { min-height: 34px; white-space: nowrap; }
.rm-control-foot, .rm-data-hint {
  color: var(--text-secondary, #64748b);
  font-size: 12px;
}
.rm-control-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}
.rm-status { min-height: 18px; text-align: right; }
.rm-status.is-error { color: #b54747; }
.rm-status.is-success { color: #1d7a68; }
.rm-data-hint {
  margin-top: 8px;
  padding: 8px 10px;
  border-left: 3px solid #d7e0e7;
  background: #f7f9fa;
}
.rm-data-hint.is-ready { border-left-color: #1d7a68; background: #f1f7f5; color: #315d55; }
.rm-trade-card {
  display: grid;
  grid-template-columns: 190px auto minmax(240px, 1fr) auto;
  align-items: end;
  gap: 14px;
  margin-bottom: 16px;
  padding: 14px 16px;
}
.rm-trade-date {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-secondary, #64748b);
  font-size: 12px;
  font-weight: 600;
}
.rm-trade-date input {
  min-height: 34px;
  box-sizing: border-box;
  border: 1px solid #d7e0e7;
  border-radius: 5px;
  padding: 0 9px;
  color: var(--text-primary, #1d2733);
  background: #fff;
  font: inherit;
  font-weight: 400;
}
.rm-trade-date input:focus {
  border-color: #1d7a68;
  outline: 2px solid rgba(29, 122, 104, .12);
}
.rm-trade-card .btn-sm { min-height: 34px; white-space: nowrap; }
.rm-crawl-progress {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  min-height: 34px;
}
.rm-progress-track {
  width: 100%;
  height: 7px;
  overflow: hidden;
  border-radius: 4px;
  background: #e8edef;
}
.rm-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: #1d7a68;
  transition: width .25s ease;
}
.rm-crawl-progress > span {
  overflow: hidden;
  color: var(--text-secondary, #64748b);
  font-size: 12px;
  line-height: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rm-trade-card .rm-status {
  align-self: center;
  max-width: 260px;
  font-size: 12px;
}
.rm-market-grid {
  display: grid;
  grid-template-columns: minmax(430px, .78fr) minmax(520px, 1.22fr);
  grid-template-areas:
    "d4-table d4-chart"
    "d5-table d5-chart";
  gap: 16px;
  align-items: stretch;
}
.rm-market-panel, .rm-chart-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.rm-market-panel--d4 { grid-area: d4-table; height: 430px; }
.rm-chart-panel--d4 { grid-area: d4-chart; height: 430px; }
.rm-market-panel--d5 { grid-area: d5-table; height: 330px; }
.rm-chart-panel--d5 { grid-area: d5-chart; height: 330px; }
.rm-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid #edf1f4;
}
.rm-panel-heading > div { min-width: 0; }
.rm-panel-heading h3 { margin: 0; font-size: 15px; }
.rm-panel-heading span { color: var(--text-secondary, #64748b); font-size: 11px; }
.rm-panel-heading label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-secondary, #64748b);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.rm-market-heading select { min-height: 30px; max-width: 130px; padding: 0 7px; }
.rm-market-scroll { min-height: 0; flex: 1; overflow: auto; padding: 0 12px 12px; }
.rm-market-table {
  width: 100%;
  min-width: 420px;
  margin: 0 auto;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 14px;
}
.rm-market-table th, .rm-market-table td {
  padding: 10px 11px;
  border-bottom: 1px solid #edf1f4;
  text-align: right;
  white-space: nowrap;
}
.rm-market-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--text-secondary, #64748b);
  font-size: 12px;
  font-weight: 600;
  background: #fbfcfd;
}
.rm-market-table th:first-child { width: 62px; text-align: center; border-right: 1px solid #dfe7e5; }
.rm-market-table td.rm-market-time { width: 62px; text-align: center; border-right: 1px solid #dfe7e5; border-left: 1px solid rgba(0, 0, 0, .45); background: #fbfcfd; }
.rm-market-table th:nth-child(2), .rm-market-side { width: 80px; text-align: center !important; }
.rm-market-table th:nth-child(3), .rm-market-price,
.rm-market-table th:nth-child(4), .rm-market-quantity { width: 130px; }
.rm-market-table th:nth-child(n+2),
.rm-market-table td.rm-market-side,
.rm-market-table td.rm-market-price,
.rm-market-table td.rm-market-quantity { border-left: 1px solid #edf1f4; }
.rm-market-side, .rm-market-price, .rm-market-quantity {
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.rm-market-side { text-align: center !important; }
.rm-market-price, .rm-market-quantity { text-align: right !important; }
.rm-market-table th:last-child,
.rm-market-table td.rm-market-price { border-right: 1px solid rgba(0, 0, 0, .45); }
.rm-market-table tbody tr.rm-market-supply { background: #fffaf5; }
.rm-market-table tbody tr.rm-market-demand { background: #f5f9fc; }
.rm-market-table tbody tr.rm-market-supply:first-child td { border-top: 1px solid rgba(0, 0, 0, .45); }
.rm-market-table tbody tr.rm-market-demand td,
.rm-market-table tbody tr.rm-market-supply td.rm-market-time { border-bottom: 1px solid rgba(0, 0, 0, .45); }
.rm-market-table tbody tr:hover { background: #eef6f3; }
.rm-market-time { vertical-align: middle; color: #315d55; font-variant-numeric: tabular-nums; font-weight: 700; }
.rm-muted-value { color: #a1adb6; }
.rm-empty { padding: 28px 12px !important; color: var(--text-secondary, #64748b); text-align: center !important; }
.rm-chart-wrap {
  position: relative;
  min-height: 0;
  flex: 1;
  padding: 10px 12px 12px;
}
.rm-chart { width: 100%; height: 100%; min-height: 220px; }
.rm-chart-empty {
  position: absolute;
  inset: 10px 12px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary, #64748b);
  font-size: 13px;
  background: #fbfcfd;
}
.rm-chart-empty[hidden] { display: none; }
@media (max-width: 1100px) {
  .rm-market-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "d4-table"
      "d4-chart"
      "d5-table"
      "d5-chart";
  }
}
@media (max-width: 720px) {
  .rm-page { padding: 16px 14px 32px; }
  .rm-quick-grid { grid-template-columns: 1fr; }
  .rm-trade-card { grid-template-columns: 1fr; align-items: stretch; }
  .rm-trade-card .rm-status { max-width: none; text-align: left; }
  .rm-control-foot { align-items: flex-start; flex-direction: column; }
  .rm-status { text-align: left; }
  .rm-market-table { width: 100%; min-width: 420px; margin: 0; }
  .rm-panel-heading { align-items: flex-start; }
  .rm-chart-panel--d4 { height: 360px; }
  .rm-chart-panel--d5 { height: 320px; }
}
