.mrs-tool {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.mrs-stat {
  padding: 10px 12px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  background: var(--bg-canvas);
  min-width: 0;
}

.mrs-stat-label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg-subtle);
  line-height: 1.3;
}

.mrs-stat-value {
  display: block;
  margin-top: 6px;
  font-size: 18px;
  font-weight: 700;
  font-family: var(--mono);
  line-height: 1.2;
}

.mrs-stat-value.is-low { color: var(--success); }
.mrs-stat-value.is-moderate { color: var(--accent-emphasis); }
.mrs-stat-value.is-high { color: #e8a838; }
.mrs-stat-value.is-critical { color: var(--danger); }

.mrs-toolbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  background: var(--bg-canvas);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
}

.mrs-toolbar-main {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
}

.mrs-field-inline {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 10px;
  color: var(--fg-subtle);
  min-width: 140px;
  flex: 0 1 200px;
}

.mrs-field-inline > span {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.mrs-select,
.mrs-search {
  width: 100%;
  min-height: 30px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-default);
  color: var(--fg-default);
  border-radius: var(--radius);
  font: inherit;
  font-size: 11px;
  padding: 6px 8px;
  box-sizing: border-box;
}

.mrs-search {
  min-width: 160px;
  flex: 1 1 180px;
  max-width: 280px;
}

.mrs-level-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  min-height: 30px;
}

.mrs-filter {
  background: var(--bg-subtle);
  border: 1px solid var(--border-default);
  color: var(--fg-muted);
  border-radius: var(--radius);
  font: inherit;
  font-size: 10px;
  padding: 6px 10px;
  cursor: pointer;
  line-height: 1.2;
}

.mrs-filter.is-active {
  color: var(--fg-default);
  border-color: var(--accent-emphasis);
  background: var(--bg-muted);
}

.mrs-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 11px;
  color: var(--fg-muted);
  padding-top: 2px;
  border-top: 1px solid var(--border-muted);
}

.mrs-meta strong { color: var(--fg-default); }

.mrs-top-risk-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  font-size: 12px;
  line-height: 1.45;
}

.mrs-top-risk-card .tf-top-pick-label {
  margin-right: 2px;
}

.mrs-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 1fr);
  gap: 10px;
  align-items: start;
}

.mrs-panel {
  background: var(--bg-canvas);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  padding: 12px;
  min-width: 0;
}

.mrs-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  min-height: 20px;
}

.mrs-panel-head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}

.mrs-count {
  font-size: 10px;
  color: var(--fg-subtle);
  white-space: nowrap;
}

.mrs-table-wrap {
  max-height: 520px;
  overflow: auto;
  background: var(--bg-canvas);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius);
  scrollbar-color: var(--bg-emphasis) var(--bg-canvas);
}

.mrs-table {
  width: 100%;
  table-layout: fixed;
}

.mrs-table th,
.mrs-table td {
  vertical-align: middle;
  padding: 6px 8px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mrs-table th:nth-child(1),
.mrs-table td:nth-child(1) { width: 16%; }
.mrs-table th:nth-child(2),
.mrs-table td:nth-child(2) { width: 24%; }
.mrs-table th:nth-child(3),
.mrs-table td:nth-child(3) { width: 11%; }
.mrs-table th:nth-child(4),
.mrs-table td:nth-child(4) { width: 15%; }
.mrs-table th:nth-child(5),
.mrs-table td:nth-child(5) { width: 13%; text-align: right; }
.mrs-table th:nth-child(6),
.mrs-table td:nth-child(6) { width: 21%; text-align: right; }

.mrs-table td:first-child {
  line-height: 1;
}

.mrs-table tbody tr { cursor: pointer; }
.mrs-table tbody tr.is-selected { background: var(--bg-muted); }

.mrs-level-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  border: 1px solid var(--border-default);
  white-space: nowrap;
  line-height: 1.2;
  vertical-align: middle;
}

.mrs-level-badge.is-low {
  color: var(--success);
  border-color: var(--success-muted);
}

.mrs-level-badge.is-moderate {
  color: var(--accent-emphasis);
  border-color: var(--accent-emphasis);
}

.mrs-level-badge.is-high {
  color: #e8a838;
  border-color: #e8a838;
}

.mrs-level-badge.is-critical {
  color: var(--danger);
  border-color: var(--danger-muted);
}

.mrs-detail-headline {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  line-height: 1.4;
}

.mrs-detail-body h4 {
  margin: 12px 0 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--fg-default);
}

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

.mrs-detail-kv {
  display: flex;
  flex-direction: column;
  min-height: 68px;
  padding: 8px 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius);
  font-size: 11px;
  box-sizing: border-box;
}

.mrs-detail-kv .k {
  min-height: 26px;
  display: flex;
  align-items: flex-end;
  color: var(--fg-subtle);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.25;
}

.mrs-detail-kv .v {
  margin-top: 6px;
  font-weight: 600;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.35;
  word-break: break-word;
}

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

.mrs-pillar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius);
  font-size: 10px;
}

.mrs-pillar-k { color: var(--fg-subtle); text-transform: uppercase; }
.mrs-pillar-v { font-weight: 600; }

.mrs-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 8px;
}

.mrs-reason {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-muted);
  border: 1px solid var(--border-default);
  color: var(--fg-muted);
}

/* Guide panel */
.mrs-tool > .tf-guide-box {
  margin-top: 2px;
}

.mrs-tool .tf-guide-box {
  background: var(--bg-canvas);
  border: 1px solid var(--border-default);
  border-left: 3px solid var(--accent-emphasis);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 11px;
  color: var(--fg-muted);
}

.mrs-tool .tf-guide-box summary {
  cursor: pointer;
  color: var(--fg-default);
  font-weight: 600;
  font-size: 12px;
  list-style: none;
}

.mrs-tool .tf-guide-box summary::-webkit-details-marker {
  display: none;
}

.mrs-tool .tf-guide-content { margin-top: 10px; }

.mrs-tool .tf-guide-intro {
  margin: 0 0 12px;
  line-height: 1.55;
  color: var(--fg-muted);
}

.mrs-tool .tf-guide-heading {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--fg-default);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.mrs-tool .tf-guide-list {
  margin: 0 0 12px;
  padding-left: 18px;
  line-height: 1.55;
}

.mrs-tool .tf-guide-list:last-child { margin-bottom: 0; }

.mrs-tool .tf-guide-list-consider li::marker { color: var(--accent-emphasis); }

@media (max-width: 1100px) {
  .mrs-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mrs-layout { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .mrs-stats { grid-template-columns: 1fr; }
  .mrs-detail-hero { grid-template-columns: 1fr; }
  .mrs-pillars { grid-template-columns: 1fr 1fr; }
  .mrs-field-inline { flex: 1 1 100%; }
  .mrs-search { max-width: none; }
}
