.repass-page .stage-tab {
  text-decoration: none;
}

.repass-page .stage-tab.active {
  background: rgba(239, 231, 211, 0.12);
  border-color: rgba(239, 231, 211, 0.48);
}

.repass-hero {
  border-bottom: 1px solid var(--rule);
}

.repass-hero .lede {
  max-width: 920px;
}

.repass-metrics .metric-value {
  letter-spacing: -0.035em;
}

.priority-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.priority-card {
  min-height: 156px;
  display: grid;
  align-content: space-between;
  gap: 16px;
  border: 1px solid var(--rule);
  background: rgba(255, 255, 255, 0.18);
  padding: 16px;
  box-shadow: 2px 2px 0 var(--ink);
}

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

.priority-rank {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  color: var(--ink-mute);
}

.priority-ticker {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.priority-company {
  margin: 4px 0 0;
  font-weight: 700;
  line-height: 1.2;
}

.priority-why {
  margin: 0;
  color: var(--ink-3);
  font-size: 13px;
  line-height: 1.35;
}

.moic-stack {
  display: grid;
  grid-auto-flow: column;
  gap: 8px;
  justify-content: start;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
}

.moic-pill {
  border: 1px solid var(--rule);
  padding: 4px 7px;
  background: var(--paper);
}

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

.sector-card {
  min-height: 128px;
  cursor: pointer;
  border: 1px solid var(--rule);
  background: rgba(255, 255, 255, 0.16);
  padding: 13px;
  text-align: left;
  display: grid;
  align-content: space-between;
  gap: 10px;
  box-shadow: 2px 2px 0 transparent;
  transition: background 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.sector-card:hover,
.sector-card.active {
  background: var(--paper);
  box-shadow: 2px 2px 0 var(--ink);
  transform: translate(-1px, -1px);
}

.sector-name {
  font-weight: 800;
  line-height: 1.15;
}

.sector-count,
.sector-foot,
.sector-stat span {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  color: var(--ink-mute);
}

.sector-stat {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.sector-stat strong {
  font-family: "Fraunces", serif;
  font-size: 28px;
  line-height: 1;
}

.sector-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--rule-hair);
  padding-top: 8px;
}

.filter-deck {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: stretch;
  margin: 12px 0 4px;
}

.range-control {
  border: 1px solid var(--rule-hair);
  background: rgba(255, 255, 255, 0.14);
  padding: 10px 12px;
  display: grid;
  grid-template-columns: minmax(110px, max-content) minmax(120px, 1fr) 52px;
  gap: 12px;
  align-items: center;
}

.range-control span,
.range-control output {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.range-control output {
  text-align: right;
  color: var(--oxblood);
  font-weight: 700;
}

.range-control input[type="range"] {
  width: 100%;
  accent-color: var(--ink);
}

.filter-actions,
.section-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.section-actions {
  flex-wrap: wrap;
}

.switch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 4px;
}

.switch-control {
  cursor: pointer;
  border: 1px solid var(--rule-hair);
  background: rgba(255, 255, 255, 0.12);
  padding: 8px 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.switch-control input {
  margin: 0;
  accent-color: var(--ink);
}

.section-actions span {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  color: var(--ink-mute);
}

.utility-button,
.icon-button {
  cursor: pointer;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  padding: 8px 11px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.utility-button:hover,
.icon-button:hover {
  background: var(--brass);
  color: var(--paper);
}

.utility-button.compact,
.icon-button.compact {
  padding: 6px 8px;
  font-size: 10px;
}

.tier-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 4px;
}

.tier-tab {
  cursor: pointer;
  border: 1px solid var(--rule);
  background: transparent;
  padding: 8px 11px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tier-tab.active {
  background: var(--brass);
  color: var(--paper);
}

.repass-table {
  table-layout: fixed;
  min-width: 1320px;
}

.repass-table th:nth-child(1),
.repass-table td:nth-child(1),
.repass-table th:nth-child(7),
.repass-table td:nth-child(7),
.repass-table th:nth-child(8),
.repass-table td:nth-child(8),
.repass-table th:nth-child(9),
.repass-table td:nth-child(9) {
  text-align: right;
  white-space: nowrap;
}

.repass-table th:nth-child(2),
.repass-table td:nth-child(2),
.repass-table th:nth-child(10),
.repass-table td:nth-child(10),
.repass-table th:nth-child(11),
.repass-table td:nth-child(11) {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  white-space: nowrap;
}

.repass-table th:nth-child(1),
.repass-table td:nth-child(1) {
  width: 48px;
}

.repass-table th:nth-child(2),
.repass-table td:nth-child(2) {
  width: 116px;
}

.repass-table th:nth-child(3),
.repass-table td:nth-child(3) {
  width: 160px;
}

.repass-table th:nth-child(4),
.repass-table td:nth-child(4) {
  width: 138px;
}

.repass-table th:nth-child(5),
.repass-table td:nth-child(5) {
  width: 112px;
}

.repass-table th:nth-child(6),
.repass-table td:nth-child(6) {
  width: 116px;
}

.repass-table th:nth-child(7),
.repass-table td:nth-child(7),
.repass-table th:nth-child(8),
.repass-table td:nth-child(8),
.repass-table th:nth-child(9),
.repass-table td:nth-child(9) {
  width: 70px;
}

.repass-table th:nth-child(10),
.repass-table td:nth-child(10) {
  width: 126px;
}

.repass-table th:nth-child(11),
.repass-table td:nth-child(11) {
  width: 76px;
}

.repass-table th:nth-child(13),
.repass-table td:nth-child(13) {
  width: 126px;
}

.rank-main,
.rank-sub {
  display: block;
}

.rank-sub {
  margin-top: 2px;
  color: var(--ink-mute);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 9px;
  line-height: 1.1;
}

.ticker-link {
  font-weight: 700;
  letter-spacing: 0.01em;
}

.tier-badge {
  display: inline-flex;
  align-items: center;
  max-width: 190px;
  border: 1px solid var(--rule-hair);
  padding: 4px 7px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.2);
}

.sector-pill,
.country-pill {
  display: inline-flex;
  align-items: center;
  max-width: 180px;
  border-left: 3px solid var(--brass);
  padding: 3px 0 3px 7px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink-2);
}

.country-pill {
  border-left-color: var(--oxblood);
  max-width: 150px;
}

.why-cell {
  min-width: 360px;
  max-width: none;
  color: var(--ink-3);
}

.rank-blurb {
  color: var(--ink);
  font-weight: 700;
  line-height: 1.35;
}

.why-detail {
  margin-top: 5px;
  color: var(--ink-mute);
  font-size: 12px;
  line-height: 1.35;
}

.risk-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 5px;
}

.risk-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--rule-hair);
  padding: 3px 5px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(255, 255, 255, 0.28);
}

.risk-pill.accounting {
  color: var(--oxblood);
  border-color: rgba(122, 31, 31, 0.42);
}

.risk-pill.cash {
  color: var(--jade);
  border-color: rgba(26, 107, 74, 0.42);
}

.risk-pill.momentum {
  color: var(--ink-2);
  border-color: rgba(47, 92, 169, 0.42);
  background: rgba(47, 92, 169, 0.08);
}

.risk-pill.momentum.weak {
  color: var(--oxblood);
  border-color: rgba(122, 31, 31, 0.42);
  background: rgba(122, 31, 31, 0.08);
}

.risk-pill.momentum.neutral {
  color: var(--ink-mute);
  border-color: rgba(91, 79, 63, 0.32);
  background: rgba(91, 79, 63, 0.08);
}

.row-actions {
  min-width: 124px;
  white-space: nowrap;
}

.row-actions .icon-button {
  margin-left: 4px;
}

.repass-table tr.is-pinned {
  background: rgba(168, 132, 26, 0.11);
}

.detail-row td {
  background: rgba(255, 255, 255, 0.24);
  border-top: 0;
}

.row-detail {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(160px, 0.8fr) minmax(110px, 0.45fr) minmax(180px, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--rule-hair);
}

.row-detail strong {
  display: block;
  line-height: 1.25;
}

.row-detail small {
  display: block;
  margin-top: 4px;
  color: var(--ink-mute);
  font-size: 11px;
  line-height: 1.25;
}

.detail-label {
  display: block;
  margin-bottom: 3px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

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

.watch-card {
  border: 1px solid var(--rule);
  background: rgba(255, 255, 255, 0.18);
  padding: 13px;
  display: grid;
  gap: 8px;
}

.watch-top,
.watch-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  color: var(--ink-mute);
}

.watch-card strong {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 15px;
}

.watch-card p,
.empty-note {
  margin: 0;
  color: var(--ink-3);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  max-width: min(360px, calc(100vw - 36px));
  border: 1px solid var(--rule);
  background: var(--brass);
  color: var(--paper);
  padding: 10px 13px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

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

.pending-card {
  border: 1px solid var(--rule);
  background: rgba(255, 255, 255, 0.18);
  padding: 14px;
  display: grid;
  gap: 8px;
}

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

.pending-card p {
  margin: 0;
  color: var(--ink-3);
  font-size: 13px;
}

.pending-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  color: var(--ink-mute);
}

@media (max-width: 1180px) {
  .sector-grid,
  .watchlist-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .filter-deck,
  .row-detail {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .sector-grid,
  .watchlist-grid,
  .priority-strip,
  .pending-grid {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .range-control {
    grid-template-columns: minmax(0, 1fr);
  }

  .repass-table th:nth-child(4),
  .repass-table td:nth-child(4),
  .repass-table th:nth-child(5),
  .repass-table td:nth-child(5),
  .repass-table th:nth-child(9),
  .repass-table td:nth-child(9),
  .repass-table th:nth-child(10),
  .repass-table td:nth-child(10),
  .repass-table th:nth-child(11),
  .repass-table td:nth-child(11) {
    display: none;
  }

  .why-cell {
    min-width: 220px;
  }
}
