/* Cards are rendered only at the same breakpoint used by trade-layout.js. */
.trading-app .trade-record-content,
.trading-app .trade-record-content > .table-wrap {
  min-width: 0;
  max-width: 100%;
}
.order-record-cards {
  display: grid;
  gap: 12px;
  padding: 12px 8px;
  min-width: 0;
}
.order-record-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel, #111a23);
  padding: 14px 12px;
}
.order-record-card summary {
  position: relative;
  list-style: none;
  cursor: pointer;
}
.order-record-card summary::-webkit-details-marker {
  display: none;
}
.order-record-card summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
  border-radius: 4px;
}
.record-card-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 8px;
  padding-inline-end: 20px;
}
.record-card-heading > b {
  font-size: 14px;
  overflow-wrap: anywhere;
}
.record-card-leverage {
  font-size: 11px;
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--line);
}
.record-card-id {
  font-size: 10px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  text-align: start;
}
.record-card-chevron {
  position: absolute;
  top: 3px;
  inset-inline-end: 2px;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg);
}
.order-record-card details[open] .record-card-chevron {
  top: 7px;
  transform: rotate(225deg);
}
.record-card-context {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
}
.record-card-context > span:last-child {
  margin-inline-start: 0;
  overflow-wrap: anywhere;
}
.record-card-context b {
  color: var(--text);
}
.record-card-side,
.record-card-effect {
  padding: 2px 6px;
  background: var(--line);
  border-radius: 4px;
}
.record-card-metrics,
.record-card-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px 8px;
  margin: 8px 0 0;
}
.record-card-details {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.record-card-metric {
  min-width: 0;
}
.record-card-metric dt {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
  padding-bottom: 2px;
  border-bottom: 1px dashed var(--line);
  overflow-wrap: anywhere;
}
.record-card-metric dd {
  margin: 3px 0 0;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.record-card-wide {
  grid-column: 1 / -1;
}
.record-card-actions {
  padding: 0;
  color: var(--text, #f0f3ef);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.trading-app .record-card-actions button {
  min-width: 0;
  min-height: 40px;
  padding: 8px;
  font-size: 12px;
  border-radius: 8px;
  background: var(--line);
  white-space: normal;
  overflow-wrap: anywhere;
}
@media (max-width: 650px) {
  .trading-app .trade-record-content > .pagination {
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
  }
}

.record-card-heading > * {
  min-width: 0;
  max-width: 100%;
}
.record-card-leverage {
  flex: none;
  white-space: nowrap;
}
.record-card-details-simple {
  grid-template-columns: minmax(0, 1fr);
}
.record-card-details .record-card-wide,
.record-card-details-simple .record-card-metric {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px 10px;
}
.record-card-details .record-card-wide dt,
.record-card-details-simple dt {
  padding: 0;
  border: 0;
}
.record-card-details .record-card-wide dd,
.record-card-details-simple dd {
  margin: 0;
}
