:root {
  --bg: #f4f6f5;
  --surface: #ffffff;
  --surface-2: #eef2f0;
  --line: #d9dfdd;
  --text: #17201d;
  --muted: #63706b;
  --root: #263238;
  --listing: #6b7f2a;
  --type: #b26038;
  --sector: #287d7d;
  --candidate: #b23b4d;
  --signal: #4f6fa8;
  --risk: #8b5d28;
  --evidence: #50805e;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.topbar h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
  font-weight: 760;
}

.topbar p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

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

.mode-switch {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-2);
}

.mode-switch button {
  min-height: 34px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  padding: 0 12px;
  cursor: pointer;
}

.mode-switch button:last-child {
  border-right: 0;
}

.mode-switch button.active {
  background: #263238;
  color: white;
}

.language-select {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfb;
  color: var(--text);
  padding: 0 28px 0 9px;
  cursor: pointer;
}

.icon-button,
.filter-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 7px;
  cursor: pointer;
  min-height: 34px;
}

.icon-button {
  padding: 0 12px;
}

.icon-button:hover,
.filter-button:hover {
  border-color: #aab5b1;
  background: #fafbfa;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border-bottom: 1px solid var(--line);
}

.hidden {
  display: none !important;
}

.metric-card {
  min-height: 96px;
  padding: 12px 16px;
  background: var(--surface);
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.metric-card strong {
  display: block;
  margin-top: 3px;
  font-size: 22px;
  line-height: 1.05;
}

.metric-card em {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.25;
}

.metric-card small {
  display: block;
  margin-top: 6px;
  color: #596661;
  font-size: 11px;
  line-height: 1.35;
}

.workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 292px minmax(680px, 1fr);
}

.explorer-workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 292px minmax(680px, 1fr);
}

.explorer-filters {
  min-height: 0;
  overflow: auto;
  border-right: 1px solid var(--line);
  background: var(--surface);
  padding: 14px;
}

.explorer-main {
  min-height: 0;
  overflow: auto;
  padding: 16px;
}

.filter-label {
  display: block;
  margin-top: 10px;
  color: #45504c;
  font-size: 12px;
  font-weight: 680;
}

.filter-label-row {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.info-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border: 1px solid #b7c2be;
  border-radius: 50%;
  background: #f5f7f6;
  color: #52605b;
  font-size: 11px;
  font-weight: 760;
  line-height: 1;
  cursor: help;
}

.info-tip:focus {
  outline: 2px solid #8bbf9a;
  outline-offset: 2px;
}

.filter-tooltip {
  position: absolute;
  z-index: 20;
  top: 23px;
  left: 0;
  display: none;
  width: min(260px, calc(100vw - 36px));
  border: 1px solid #c9d7d4;
  border-left: 4px solid #287d7d;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(23, 32, 29, 0.16);
  color: #34423d;
  padding: 9px 10px;
  font-weight: 500;
}

.filter-tooltip strong,
.filter-tooltip span {
  display: block;
  font-size: 11px;
  line-height: 1.45;
}

.filter-tooltip strong {
  margin-bottom: 4px;
  color: #17201d;
  font-weight: 760;
}

.filter-tooltip span + span {
  margin-top: 5px;
}

.filter-label-row:hover .filter-tooltip,
.filter-label-row:focus-within .filter-tooltip {
  display: block;
}

.filter-label select,
.range-row input,
#sort-results {
  width: 100%;
  height: 36px;
  margin-top: 5px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfb;
  color: var(--text);
  padding: 0 9px;
}

.filter-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.range-row {
  margin-top: 10px;
}

.range-row span {
  display: block;
  color: #45504c;
  font-size: 12px;
  font-weight: 680;
}

.range-row div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  color: #3f4a46;
  font-size: 13px;
}

.wide-button {
  width: 100%;
  min-height: 38px;
  margin-top: 14px;
  border: 1px solid #263238;
  border-radius: 7px;
  background: #263238;
  color: white;
  cursor: pointer;
}

.explorer-toolbar,
.results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.explorer-toolbar h2,
.results-head h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.explorer-toolbar p,
.results-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

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

.upcoming-picker {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(260px, 1.3fr);
  gap: 12px;
  align-items: center;
  margin-top: 10px;
  border: 1px solid #c9d7d4;
  border-left: 4px solid #287d7d;
  border-radius: 8px;
  background: #f4f8f7;
  padding: 10px;
}

.upcoming-picker strong {
  display: block;
  font-size: 13px;
}

.upcoming-picker p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.upcoming-candidate-grid {
  display: grid;
  gap: 8px;
}

.upcoming-candidate-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  padding: 8px 9px;
  text-align: left;
  cursor: pointer;
}

.upcoming-candidate-button:hover {
  border-color: #8bbf9a;
  background: #ffffff;
}

.upcoming-candidate-button strong,
.upcoming-candidate-button em {
  display: block;
}

.upcoming-candidate-button em {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.upcoming-candidate-button small {
  flex: 0 0 auto;
  color: #3d6d4b;
  font-size: 11px;
  font-weight: 760;
}

.explorer-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.kpi-card {
  min-height: 126px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface);
}

.kpi-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.kpi-card strong {
  display: block;
  margin-top: 5px;
  font-size: 22px;
  line-height: 1.1;
}

.kpi-card em {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  line-height: 1.25;
}

.kpi-card small {
  display: block;
  margin-top: 7px;
  color: #596661;
  font-size: 11px;
  line-height: 1.35;
}

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

.search-hint {
  margin-top: 10px;
  border: 1px solid #c9d7d4;
  border-left: 4px solid #4f6fa8;
  border-radius: 8px;
  background: #f3f7fb;
  color: #33465f;
  padding: 9px 10px;
  font-size: 12px;
}

.insight-card {
  min-height: 70px;
  border: 1px solid var(--line);
  border-left: 4px solid #287d7d;
  border-radius: 8px;
  background: var(--surface);
  padding: 10px;
}

.insight-card strong {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
}

.insight-card p {
  margin: 0;
  color: #4f5a56;
  font-size: 12px;
  line-height: 1.45;
}

.regime-panel {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

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

.regime-head h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.2;
}

.regime-head p,
.regime-method {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.regime-method {
  margin-top: 8px;
  border-left: 4px solid #4f6fa8;
  border-radius: 7px;
  background: #f3f7fb;
  color: #33465f;
  padding: 8px 10px;
}

.regime-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.regime-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px;
}

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

.regime-card-head strong {
  font-size: 13px;
}

.regime-card-head span {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.regime-card-main {
  margin-top: 8px;
}

.regime-card-main b {
  display: block;
  font-size: 24px;
  line-height: 1.05;
}

.regime-card-main span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.regime-card dl {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
}

.regime-card dl div {
  display: grid;
  grid-template-columns: minmax(82px, 0.82fr) minmax(0, 1fr);
  gap: 8px;
  min-height: 18px;
}

.regime-card dt,
.regime-card dd {
  margin: 0;
  font-size: 11px;
  line-height: 1.3;
}

.regime-card dt {
  color: var(--muted);
}

.regime-card dd {
  overflow: hidden;
  color: #2e3935;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
}

.regime-card.regime-hot {
  border-top: 4px solid #287d7d;
}

.regime-card.regime-mixed {
  border-top: 4px solid #8b5d28;
}

.regime-card.regime-cold {
  border-top: 4px solid #b23b4d;
}

.regime-card.regime-watch {
  border-top: 4px solid #7d8890;
}

.regime-section-title {
  margin-top: 13px;
  margin-bottom: 8px;
  color: #33403b;
  font-size: 13px;
  font-weight: 760;
}

.regime-timeline {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.regime-badge {
  min-width: 82px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 7px 8px;
}

.regime-badge b,
.regime-badge em,
.regime-badge small {
  display: block;
  line-height: 1.2;
}

.regime-badge b {
  font-size: 12px;
}

.regime-badge em {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.regime-badge small {
  margin-top: 3px;
  color: #33403b;
  font-size: 11px;
}

.regime-badge.regime-hot,
.regime-pill.regime-hot {
  border-color: #8ac0b8;
  background: #edf7f4;
  color: #145c57;
}

.regime-badge.regime-mixed,
.regime-pill.regime-mixed {
  border-color: #d8c09d;
  background: #fbf6ee;
  color: #76501e;
}

.regime-badge.regime-cold,
.regime-pill.regime-cold {
  border-color: #e2a7b0;
  background: #fbf0f2;
  color: #8d2d3b;
}

.regime-badge.regime-watch,
.regime-pill.regime-watch {
  border-color: #c7d0d4;
  background: #f3f5f6;
  color: #55626a;
}

.regime-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 760;
  white-space: nowrap;
}

.regime-table {
  max-height: 390px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.regime-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.regime-table th,
.regime-table td {
  padding: 7px 8px;
  border-bottom: 1px solid #e8ecea;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.regime-table th {
  position: sticky;
  z-index: 1;
  top: 0;
  background: #f2f5f3;
  color: #43504b;
  font-weight: 760;
}

.regime-table td:last-child {
  white-space: normal;
  min-width: 240px;
}

.advanced-panel {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

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

.advanced-head h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.2;
}

.advanced-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

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

.advanced-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 10px;
}

.advanced-card h4 {
  margin: 0;
  font-size: 13px;
  line-height: 1.25;
}

.advanced-card > p {
  min-height: 36px;
  margin: 5px 0 9px;
  color: #4f5a56;
  font-size: 12px;
  line-height: 1.42;
}

.advanced-table {
  max-height: 285px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
}

.advanced-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.advanced-table th,
.advanced-table td {
  padding: 6px 7px;
  border-bottom: 1px solid #e8ecea;
  text-align: left;
  vertical-align: top;
}

.advanced-table th {
  position: sticky;
  z-index: 1;
  top: 0;
  background: #f2f5f3;
  color: #43504b;
  font-weight: 760;
}

.advanced-table td:nth-child(n + 3) {
  white-space: nowrap;
}

.advanced-table td:nth-child(2) {
  min-width: 170px;
}

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

.chart-panel,
.results-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.chart-panel {
  padding: 12px;
  min-height: 280px;
}

.chart-panel-wide {
  grid-column: span 2;
}

.chart-title {
  font-size: 13px;
  font-weight: 760;
  margin-bottom: 10px;
}

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

.bar-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.86fr) minmax(160px, 1.4fr) 72px;
  gap: 8px;
  align-items: center;
  min-height: 25px;
  font-size: 12px;
}

.bar-label {
  color: #33403b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  position: relative;
  height: 16px;
  border-radius: 999px;
  background: #edf1ef;
  overflow: hidden;
}

.bar-fill {
  position: absolute;
  left: 50%;
  top: 0;
  height: 100%;
  min-width: 2px;
  background: #287d7d;
}

.bar-fill.negative {
  left: auto;
  right: 50%;
  background: #b23b4d;
}

.bar-zero {
  position: absolute;
  left: 50%;
  top: 0;
  width: 1px;
  height: 100%;
  background: rgba(23, 32, 29, 0.35);
}

.bar-value {
  color: #33403b;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.boxplot-chart {
  display: grid;
  gap: 9px;
}

.boxplot-axis,
.boxplot-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.9fr) minmax(220px, 1.6fr) minmax(150px, 0.9fr);
  gap: 10px;
  align-items: center;
}

.boxplot-axis-scale {
  position: relative;
  min-height: 14px;
  color: var(--muted);
  font-size: 10px;
}

.boxplot-axis-scale em {
  position: absolute;
  top: 0;
  font-style: normal;
  white-space: nowrap;
}

.boxplot-axis-scale em:first-child {
  left: 0;
}

.boxplot-axis-scale em:nth-child(2) {
  transform: translateX(-50%);
}

.boxplot-axis-scale em:last-child {
  right: 0;
}

.boxplot-row {
  min-height: 32px;
  font-size: 12px;
}

.boxplot-label {
  color: #33403b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.boxplot-track {
  position: relative;
  height: 24px;
  border-radius: 999px;
  background: #edf1ef;
  overflow: hidden;
}

.boxplot-zero {
  position: absolute;
  top: 0;
  width: 1px;
  height: 100%;
  background: rgba(23, 32, 29, 0.32);
}

.boxplot-whisker {
  position: absolute;
  top: 11px;
  height: 2px;
  background: #8b9994;
}

.boxplot-box {
  position: absolute;
  top: 5px;
  height: 14px;
  border: 1px solid #287d7d;
  border-radius: 4px;
  background: rgba(40, 125, 125, 0.22);
}

.boxplot-median {
  position: absolute;
  top: 3px;
  width: 2px;
  height: 18px;
  background: #17201d;
}

.boxplot-mean {
  position: absolute;
  top: 8px;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: #b23b4d;
  box-shadow: 0 0 0 1px rgba(178, 59, 77, 0.35);
}

.boxplot-value {
  color: #33403b;
  text-align: right;
  font-size: 11px;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}

.results-panel {
  margin-top: 14px;
  padding: 12px;
}

.results-head {
  margin-bottom: 10px;
}

#sort-results {
  width: 180px;
  margin-top: 0;
}

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

.large-table {
  max-height: 520px;
}

.left-panel,
.right-panel {
  min-height: 0;
  overflow: auto;
  background: var(--surface);
}

.left-panel {
  border-right: 1px solid var(--line);
  padding: 14px;
}

.right-panel {
  border-left: 1px solid var(--line);
}

.review-panel {
  border-left: 0;
}

.review-panel .inspector {
  border-bottom: 0;
}

.section-title {
  margin: 16px 0 8px;
  color: #45504c;
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
}

.section-title:first-child {
  margin-top: 0;
}

.search-box {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  outline: none;
  background: #fbfcfb;
}

.search-box:focus {
  border-color: #7aa6a1;
  box-shadow: 0 0 0 3px rgba(40, 125, 125, 0.12);
}

.filter-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

.view-note {
  margin-top: 10px;
  padding: 9px 10px;
  border: 1px solid #c9d7d4;
  border-left: 4px solid #287d7d;
  border-radius: 8px;
  background: #f4f8f7;
  color: #3f4f4a;
  font-size: 12px;
  line-height: 1.45;
}

.candidate-list {
  display: grid;
  gap: 8px;
}

.candidate-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--text);
  padding: 9px 10px;
  text-align: left;
  cursor: pointer;
}

.candidate-button:hover {
  border-color: #aab5b1;
  background: #f6f9f7;
}

.candidate-button.active {
  border-color: #50805e;
  border-left: 4px solid #50805e;
  background: #f1f8f3;
}

.candidate-button strong,
.candidate-button em,
.candidate-schedule {
  display: block;
}

.candidate-button strong {
  font-size: 13px;
  line-height: 1.25;
}

.candidate-button em {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  line-height: 1.3;
}

.candidate-main {
  min-width: 0;
}

.candidate-schedule {
  margin-top: 6px;
  color: #315d55;
  font-size: 10px;
  font-weight: 720;
  line-height: 1.35;
}

.candidate-button small {
  flex: 0 0 auto;
  color: #3d6d4b;
  font-size: 11px;
  font-weight: 760;
}

.filter-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  text-align: left;
}

.filter-button.off {
  color: #87918d;
  background: #f4f6f5;
}

.filter-dot {
  flex: 0 0 9px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

.filter-count {
  color: var(--muted);
  font-size: 12px;
}

.reading-list {
  margin: 0;
  padding-left: 20px;
  color: #4f5a56;
  font-size: 13px;
  line-height: 1.7;
}

.inspector {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.inspector-kicker {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 760;
}

.inspector h2 {
  margin: 6px 0 8px;
  font-size: 21px;
  line-height: 1.18;
}

.inspector p {
  margin: 0 0 12px;
  color: #3f4a46;
  font-size: 13px;
  line-height: 1.55;
}

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

.detail-metric {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px;
  min-width: 0;
}

.detail-metric.is-highlighted {
  border-color: #8bbf9a;
  border-left: 4px solid #50805e;
  background: #f1f8f3;
}

.detail-metric.is-highlighted span {
  color: #3d6d4b;
}

.detail-metric.is-highlighted strong {
  color: #234f34;
}

.detail-metric span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-metric strong {
  display: block;
  margin-top: 2px;
  font-size: 15px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  color: #45504c;
  font-size: 11px;
  background: #f9faf9;
}

.upcoming-stats-section {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.upcoming-stats-table-wrap {
  max-height: 360px;
  margin-top: 9px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.upcoming-stats-table th,
.upcoming-stats-table td {
  white-space: normal;
}

.upcoming-stats-table td:first-child {
  min-width: 170px;
}

.upcoming-stats-table td:nth-child(4) {
  min-width: 180px;
}

.upcoming-stats-table tr.is-selected td {
  background: #f1f8f3;
}

.upcoming-stats-table small {
  color: var(--muted);
  font-size: 10px;
}

.stat-view-pill {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  border: 1px solid #cbd8d4;
  border-radius: 999px;
  padding: 3px 8px;
  background: #f6f8f7;
  color: #3f4f4a;
  font-size: 11px;
  font-weight: 780;
  white-space: nowrap;
}

.stat-view-pill.positive {
  border-color: #94c5a1;
  background: #eef8f1;
  color: #23563a;
}

.stat-view-pill.selective {
  border-color: #b8d8ca;
  background: #f0faf7;
  color: #22615a;
}

.stat-view-pill.watch {
  border-color: #d8ca9c;
  background: #fff8e6;
  color: #66520f;
}

.stat-view-pill.low {
  border-color: #e4bdba;
  background: #fff0ef;
  color: #84302c;
}

.stat-view-pill.negative {
  border-color: #e4bdba;
  background: #fff0ef;
  color: #84302c;
}

.fundamental-section {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.fundamental-verdict {
  display: grid;
  gap: 8px;
  margin-top: 9px;
  padding: 10px 0;
}

.fundamental-verdict p {
  margin: 0;
  color: #33413d;
  font-size: 12px;
  line-height: 1.55;
}

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

.fundamental-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfb;
}

.fundamental-list > strong {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  color: #24302c;
}

.fundamental-list ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.fundamental-list .signal-chip {
  width: 100%;
  justify-content: flex-start;
  border-radius: 8px;
  padding: 7px 8px;
  white-space: normal;
  text-align: left;
}

.signal-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 180px;
}

.signal-chip {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  border: 1px solid #d5dedb;
  border-radius: 999px;
  padding: 2px 7px;
  background: #f8faf9;
  color: #4c5a55;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
}

.signal-chip.positive {
  border-color: #bddac8;
  background: #f0f8f3;
  color: #2c6540;
}

.signal-chip.watch {
  border-color: #dfd2a4;
  background: #fff9e8;
  color: #6a5514;
}

.signal-chip.negative {
  border-color: #e5bebc;
  background: #fff1ef;
  color: #88332f;
}

.peer-section {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 2px;
}

.peer-head strong {
  display: block;
  font-size: 13px;
  line-height: 1.3;
}

.peer-head p {
  margin: 4px 0 8px;
  color: #4f5a56;
  font-size: 12px;
  line-height: 1.45;
}

.peer-summary {
  margin-bottom: 8px;
  border: 1px solid #c9d7d4;
  border-left: 4px solid #4f6fa8;
  border-radius: 7px;
  background: #f3f7fb;
  color: #33465f;
  padding: 7px 8px;
  font-size: 12px;
  line-height: 1.4;
}

.peer-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.peer-stat-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfb;
  padding: 8px;
}

.peer-stat-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.peer-stat-card strong {
  display: block;
  margin-top: 4px;
  font-size: 16px;
  line-height: 1.2;
}

.peer-preview {
  margin-top: 12px;
}

.peer-demand-note {
  margin-top: 8px;
  border: 1px solid #e3d6b8;
  border-left: 4px solid #8b5d28;
  border-radius: 7px;
  background: #fbf6ee;
  color: #6f4b1f;
  padding: 7px 8px;
  font-size: 12px;
  line-height: 1.4;
}

.peer-preview-list {
  display: grid;
  gap: 8px;
}

.peer-preview-item {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  padding: 9px 10px;
}

.peer-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.peer-preview-head strong {
  min-width: 0;
  font-size: 13px;
  line-height: 1.3;
}

.peer-return {
  flex: 0 0 auto;
  border: 1px solid #c9d7d4;
  border-radius: 999px;
  background: #f4f8f7;
  color: #2d6159;
  padding: 3px 7px;
  font-size: 12px;
  font-weight: 760;
  line-height: 1.2;
}

.peer-return.strong {
  border-color: #8bbf9a;
  background: #f1f8f3;
  color: #2f6b3f;
}

.peer-return.negative {
  border-color: #e2a7b0;
  background: #fbf0f2;
  color: #8d2d3b;
}

.peer-preview-meta,
.peer-demand-line,
.peer-preview-item p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.peer-demand-line {
  color: #374b65;
  font-weight: 680;
}

.peer-action-row {
  margin-top: 12px;
}

.peer-explorer-button {
  margin-top: 0;
}

.table-view {
  overflow: auto;
  max-height: 45vh;
  border: 1px solid var(--line);
  border-radius: 7px;
}

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

.data-table th,
.data-table td {
  padding: 8px 9px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef2f0;
  font-size: 11px;
  color: #45504c;
}

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

.deals-workspace {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.deals-main {
  padding: 16px;
}

.deals-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.deals-toolbar h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.deals-toolbar p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.deal-filter-tabs {
  display: inline-flex;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  overflow: hidden;
}

.deal-filter-tabs button {
  min-height: 34px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  padding: 0 12px;
  cursor: pointer;
}

.deal-filter-tabs button:last-child {
  border-right: 0;
}

.deal-filter-tabs button.active {
  background: #263238;
  color: #ffffff;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(20, 32, 31, 0.36);
  backdrop-filter: blur(4px);
}

.auth-card {
  width: min(420px, 100%);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 22px 60px rgba(20, 32, 31, 0.22);
}

.auth-card h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
}

.auth-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.auth-field {
  display: grid;
  gap: 7px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.auth-field input {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 16px;
}

.auth-error {
  min-height: 18px;
  margin-top: 8px;
  color: #b3261e;
  font-size: 12px;
  font-weight: 700;
}

.auth-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.deals-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.deal-kpi-card {
  min-height: 96px;
}

.deals-chart-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 12px;
}

.deals-rubric-panel {
  margin-top: 12px;
}

.rubric-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 12px;
}

.rubric-table-wrap {
  overflow: auto;
}

.rubric-table th,
.rubric-table td {
  white-space: normal;
  line-height: 1.45;
}

.rubric-table td:first-child {
  min-width: 116px;
  color: #243d37;
}

.rubric-table td:nth-child(2),
.rubric-table td:nth-child(3) {
  min-width: 190px;
}

.rubric-table td:nth-child(4) {
  min-width: 260px;
  color: #3f4a46;
}

.rubric-legend {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
  padding: 12px;
}

.rubric-legend h4 {
  margin: 0 0 10px;
  font-size: 13px;
}

.rubric-legend-row {
  display: grid;
  gap: 3px;
  padding: 9px 0;
  border-top: 1px solid #dfe7e4;
}

.rubric-legend-row:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.rubric-legend-row strong {
  color: #235f5f;
  font-size: 12px;
}

.rubric-legend-row span,
.rubric-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.rubric-note {
  margin: 10px 0 0;
}

.count-fill {
  background: #287d7d;
}

.deal-table small {
  color: var(--muted);
  font-size: 11px;
}

.deal-table th,
.deal-table td {
  white-space: normal;
}

.deal-table td:first-child {
  min-width: 130px;
}

.deal-table td:nth-child(4) {
  min-width: 190px;
}

.sponsor-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border: 1px solid #cbd8d4;
  border-radius: 999px;
  background: #f8faf9;
  color: #314640;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 760;
  white-space: nowrap;
}

.allocation-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border: 1px solid #cbd8d4;
  border-radius: 999px;
  padding: 2px 8px;
  background: #f4f8f7;
  color: #35524a;
  font-size: 11px;
  font-weight: 760;
  white-space: nowrap;
}

.allocation-badge.status-pending {
  border-color: #d8ca9c;
  background: #fff7dc;
  color: #6c550c;
}

.allocation-badge.status-allocated {
  border-color: #b9d2c4;
  background: #ecf7f0;
  color: #23563a;
}

.allocation-badge.status-noAllocation {
  border-color: #e4bdba;
  background: #fff0ef;
  color: #8b332e;
}

.allocation-badge.status-notParticipated {
  border-color: #cbd1d6;
  background: #f3f5f6;
  color: #4f5b63;
}

.deal-sort-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  font: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.deal-sort-button em {
  min-width: 10px;
  color: #287d7d;
  font-size: 10px;
  font-style: normal;
  line-height: 1;
}

.deal-sort-button:not(.active) em {
  color: transparent;
}

.deal-sort-button:hover span,
.deal-sort-button.active span {
  color: #236d6c;
}

.return-cell {
  display: grid;
  gap: 3px;
  min-width: 104px;
}

.return-cell strong {
  font-size: 13px;
}

.return-cell small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
}

.return-cell-positive strong {
  color: #18735d;
}

.return-cell-negative strong {
  color: #a13b35;
}

.return-cell-neutral strong {
  color: #3c514c;
}

.pnl-input-wrap {
  display: grid;
  gap: 4px;
  min-width: 116px;
}

.pnl-input {
  width: 100%;
  min-height: 32px;
  border: 1px solid #cbd8d4;
  border-radius: 7px;
  background: #fbfcfb;
  color: var(--text);
  padding: 5px 8px;
  font-size: 12px;
  text-align: right;
}

.pnl-input:focus {
  border-color: #287d7d;
  outline: 2px solid rgba(40, 125, 125, 0.14);
}

.pnl-input-wrap span,
.pnl-disabled {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
}

.deals-review-panel {
  margin-top: 12px;
}

.deal-review-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.deal-review-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.deal-review-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.deal-review-head h4 {
  margin: 0;
  font-size: 15px;
  line-height: 1.25;
}

.deal-review-head h4 span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 620;
}

.deal-review-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.deal-review-head strong {
  flex: 0 0 auto;
  border: 1px solid #c9d7d4;
  border-radius: 7px;
  background: #f4f8f7;
  color: #2f6040;
  padding: 5px 8px;
  font-size: 12px;
}

.deal-review-status {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-end;
  flex-direction: column;
  gap: 6px;
}

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

.deal-review-body span {
  display: block;
  color: #45504c;
  font-size: 11px;
  font-weight: 760;
}

.deal-review-body p {
  margin: 5px 0 0;
  color: #3f4a46;
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 260px minmax(560px, 1fr);
  }

  .explorer-workspace {
    grid-template-columns: 260px minmax(560px, 1fr);
  }

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

  .explorer-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

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

  .insight-band {
    grid-template-columns: 1fr;
  }

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

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

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

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

@media (max-width: 900px) {
  .workspace {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }

  .left-panel,
  .right-panel {
    border: 0;
    border-bottom: 1px solid var(--line);
  }

  .right-panel {
    border-top: 1px solid var(--line);
  }

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

  .explorer-workspace {
    grid-template-columns: 1fr;
  }

  .explorer-filters {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .deals-chart-grid {
    grid-template-columns: 1fr;
  }

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

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

  .chart-panel-wide {
    grid-column: span 1;
  }

  .boxplot-axis,
  .boxplot-row {
    grid-template-columns: minmax(110px, 0.8fr) minmax(160px, 1.4fr) minmax(110px, 0.8fr);
  }

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

  .upcoming-picker {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .deals-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .deal-review-body {
    grid-template-columns: 1fr;
  }
}
