:root {
  --app-ink: #173435;
  --app-muted: #667674;
  --app-bg: #f3f6f4;
  --app-panel: #fff;
  --app-brand: #0f5b55;
  --app-brand-dark: #0b4742;
  --app-line: #dce5e1;
  --app-accent: #e6f4ef;
}

.app-body,
.app-body *,
.app-body *::before,
.app-body *::after {
  box-sizing: border-box;
}

.app-body {
  margin: 0;
  background: var(--app-bg);
  color: var(--app-ink);
}

.app-body button,
.app-body input,
.app-body select {
  font: inherit;
}

.app-body .btn {
  display: inline-flex;
  min-height: 2.65rem;
  align-items: center;
  justify-content: center;
  padding: .62rem 1rem;
  border: 1px solid transparent;
  border-radius: .7rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease,
    color .15s ease, box-shadow .15s ease;
}

.app-body .btn:focus-visible,
.app-body .form-select:focus-visible,
.workspace-switcher summary:focus-visible,
.workspace-menu button:focus-visible,
.app-menu-toggle:focus-visible,
.app-menu-close:focus-visible {
  outline: 3px solid rgba(22, 89, 90, .24);
  outline-offset: 2px;
}

.app-body .btn-primary {
  border-color: var(--app-brand);
  background: var(--app-brand);
  color: #fff;
}

.app-body .btn-primary:hover {
  border-color: var(--app-brand-dark);
  background: var(--app-brand-dark);
  color: #fff;
}

.app-body .btn-dark {
  border-color: var(--app-ink);
  background: var(--app-ink);
  color: #fff;
}

.app-body .btn-dark:hover {
  background: #0e2527;
}

.app-body .btn-outline-dark,
.app-body .btn-outline-secondary {
  border-color: #81908d;
  background: #fff;
  color: var(--app-ink);
}

.app-body .btn-outline-dark:hover,
.app-body .btn-outline-secondary:hover {
  border-color: var(--app-brand);
  background: var(--app-accent);
  color: var(--app-brand-dark);
}

.app-body .btn-sm {
  min-height: 2.25rem;
  padding: .45rem .75rem;
  font-size: .88rem;
}

.app-body .btn-link {
  min-height: auto;
  padding: .35rem;
  border-color: transparent;
  background: transparent;
  color: var(--app-brand);
}

.app-body .w-100 {
  width: 100%;
}

.app-body .form-select {
  width: 100%;
  min-height: 2.65rem;
  padding: .55rem 2.25rem .55rem .75rem;
  border: 1px solid #afbfbb;
  border-radius: .62rem;
  background-color: #fff;
  color: var(--app-ink);
}

.app-body .small {
  font-size: .84rem;
}

.app-body .text-secondary {
  color: var(--app-muted);
}

.app-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  background: #123f3c;
  color: #fff;
  display: flex;
  flex-direction: column;
}

.app-sidebar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 1.15rem;
  text-decoration: none;
}

.app-menu-close {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: .65rem;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-size: 1.55rem;
  line-height: 1;
  cursor: pointer;
}

.workspace-summary {
  margin: 28px 0 20px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 12px;
  display: grid;
  gap: 3px;
}

.workspace-summary span,
.workspace-summary small {
  color: #bcd1cd;
  font-size: .78rem;
}

.app-nav {
  display: grid;
  gap: 5px;
}

.app-nav p {
  margin: 20px 10px 4px;
  color: #9fc0bb;
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.app-nav a {
  padding: 10px 12px;
  border-radius: 8px;
  color: #dfeae7;
  text-decoration: none;
}

.app-nav a:hover,
.app-nav a.active {
  background: rgba(255, 255, 255, .12);
  color: #fff;
}

.app-sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 8px;
}

.app-sidebar-footer a,
.app-sidebar-footer button {
  padding: 5px 10px;
  border: 0;
  background: none;
  color: #c8dcd8;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.app-sidebar-footer a:hover,
.app-sidebar-footer button:hover {
  color: #fff;
}

.app-menu-backdrop {
  display: none;
}

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

.app-topbar {
  position: relative;
  z-index: 20;
  height: 64px;
  padding: 0 32px;
  border-bottom: 1px solid var(--app-line);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.app-menu-toggle {
  display: none;
}

.app-user {
  color: var(--app-muted);
  font-size: .9rem;
}

.app-context-switchers {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.company-navigation {
  margin-bottom: 24px;
  padding: 12px 14px;
  border: 1px solid var(--app-line);
  border-radius: .9rem;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  box-shadow: 0 8px 24px rgba(23, 52, 53, .05);
}

.company-navigation-context {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.company-navigation-context span {
  color: var(--app-muted);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.company-navigation-context strong {
  overflow: hidden;
  color: var(--app-ink);
  font-size: .95rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.company-navigation-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.company-navigation-links a {
  padding: .55rem .8rem;
  border-radius: .6rem;
  color: var(--app-muted);
  font-size: .86rem;
  font-weight: 750;
  text-decoration: none;
}

.company-navigation-links a:hover,
.company-navigation-links a.active {
  background: var(--app-accent);
  color: var(--app-brand);
}

.linked-company-row {
  padding: .8rem 0;
  border-bottom: 1px solid var(--app-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.linked-company-row:last-child {
  border-bottom: 0;
}

.linked-company-row p {
  margin: 0;
}

.monitor-card h3 a {
  color: inherit;
  text-decoration: none;
}

.monitor-card h3 a:hover {
  color: var(--app-brand);
}

.company-card-actions {
  flex-wrap: wrap;
}

.monitor-grid > .empty-state {
  grid-column: 1 / -1;
}

.company-setup-panel {
  margin-bottom: 24px;
}

.company-setup-steps {
  margin: 22px 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  list-style: none;
}

.company-setup-steps li {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--app-line);
  border-radius: .75rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.company-setup-steps li > span {
  width: 1.8rem;
  height: 1.8rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--app-accent);
  color: var(--app-brand);
  display: inline-grid;
  place-items: center;
  font-size: .78rem;
  font-weight: 850;
}

.company-setup-steps li.complete > span {
  background: var(--app-brand);
  color: #fff;
}

.company-setup-steps li div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.company-setup-steps small,
.company-monitor-health span {
  color: var(--app-muted);
}

.company-monitor-health {
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 24px;
}

.company-monitor-health h2,
.company-monitor-health p {
  margin-bottom: 0;
}

.company-monitor-health > div:nth-child(2) {
  display: grid;
  gap: 2px;
}

.member-readonly-note {
  margin: 0 0 22px;
  padding: .8rem 1rem;
  border: 1px solid #cbd9d5;
  border-radius: .7rem;
  background: #f5f9f7;
  color: var(--app-muted);
}

.workspace-switcher {
  position: relative;
}

.workspace-switcher summary {
  min-width: 220px;
  padding: .48rem 2rem .48rem .75rem;
  border: 1px solid #b7c4c1;
  border-radius: .65rem;
  background: #fff;
  color: var(--app-ink);
  font-size: .88rem;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
}

.switcher-prefix {
  color: var(--app-muted);
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.switcher-value,
.account-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-context-switcher summary {
  min-width: 180px;
}

.account-switcher summary {
  min-width: 210px;
}

.account-avatar {
  width: 1.7rem;
  height: 1.7rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--app-brand);
  color: #fff;
  display: inline-grid;
  place-items: center;
  font-size: .72rem;
  font-weight: 800;
}

.workspace-switcher summary::-webkit-details-marker {
  display: none;
}

.workspace-switcher summary::after {
  position: absolute;
  top: .58rem;
  right: .75rem;
  content: "▾";
  color: var(--app-muted);
}

.workspace-switcher[open] summary::after {
  content: "▴";
}

.workspace-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 50;
  width: min(320px, calc(100vw - 32px));
  padding: 6px;
  border: 1px solid var(--app-line);
  border-radius: .75rem;
  background: #fff;
  box-shadow: 0 16px 40px rgba(23, 52, 53, .16);
}

.workspace-menu form {
  margin: 0;
}

.account-menu-identity {
  padding: .65rem .75rem .8rem;
  border-bottom: 1px solid var(--app-line);
  display: grid;
  gap: 2px;
}

.account-menu-identity strong {
  overflow-wrap: anywhere;
  font-size: .85rem;
}

.account-menu-identity span {
  color: var(--app-muted);
  font-size: .74rem;
}

.workspace-menu button,
.workspace-menu > a {
  width: 100%;
  padding: .7rem .75rem;
  border: 0;
  border-radius: .55rem;
  background: transparent;
  color: var(--app-ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
}

.workspace-menu button:hover,
.workspace-menu button.active,
.workspace-menu > a:hover,
.workspace-menu > a.active {
  background: var(--app-accent);
}

.workspace-menu button span,
.workspace-menu > a span {
  color: var(--app-brand);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.app-content,
.app-flashes {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px;
}

.app-flashes {
  padding-bottom: 0;
}

.app-auth-flashes {
  max-width: 540px;
  padding: 24px 12px 0;
}

.alert {
  padding: .85rem 1rem;
  border: 1px solid #b8cbc5;
  border-radius: .75rem;
  background: #fff;
  color: var(--app-ink);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 8px 24px rgba(23, 52, 53, .08);
}

.alert-info {
  border-color: #a9c9df;
  background: #edf7fd;
  color: #214f6b;
}

.alert-success {
  border-color: #a9d0bd;
  background: #edf8f2;
  color: #1d5d3d;
}

.alert-error,
.alert-danger {
  border-color: #e2b5ad;
  background: #fff2ef;
  color: #7c3026;
}

.alert-warning {
  border-color: #e8cf92;
  background: #fff8e5;
  color: #765a18;
}

.alert-close {
  flex: 0 0 auto;
  width: 1.8rem;
  height: 1.8rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: currentColor;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

.app-page-heading {
  margin-bottom: 28px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.app-page-heading h1 {
  margin: .1rem 0 .4rem;
  font-size: 2rem;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.app-page-heading p {
  margin: 0;
  color: var(--app-muted);
}

.app-eyebrow {
  color: var(--app-brand) !important;
  font-size: .72rem !important;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.metric-grid {
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.metric-grid article {
  padding: 20px;
  border: 1px solid var(--app-line);
  border-radius: 14px;
  background: var(--app-panel);
  display: grid;
  gap: 8px;
}

.metric-grid span {
  color: var(--app-muted);
}

.metric-grid strong {
  font-size: 2rem;
}

.app-panel {
  padding: 24px;
  border: 1px solid var(--app-line);
  border-radius: 14px;
  background: var(--app-panel);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.panel-heading h2,
.detail-section h2,
.decision-card h2 {
  margin: 0 0 6px;
  font-size: 1.15rem;
}

.panel-heading a,
.back-link {
  color: var(--app-brand);
  font-weight: 700;
  text-decoration: none;
}

.panel-heading a:hover,
.back-link:hover {
  text-decoration: underline;
}

.historical-opportunity-notice {
  align-items: flex-start;
  background: #fff7df;
  border: 1px solid #ecd99a;
  border-radius: 14px;
  color: #574817;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 1rem 0 1.25rem;
  padding: 0.9rem 1rem;
}

.historical-opportunity-notice span {
  color: #70612b;
  font-size: 0.9rem;
}

.source-data-warning {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1rem 0;
  padding: 1rem 1.1rem;
  border: 1px solid #e4b76a;
  border-radius: .9rem;
  background: #fff8e8;
  color: #684514;
}

.source-data-warning p {
  margin: .25rem 0 0;
}

.source-data-warning a {
  flex: 0 0 auto;
  color: inherit;
  font-weight: 750;
}

.source-data-warning-badge {
  display: inline-flex;
  padding: .28rem .55rem;
  border-radius: 999px;
  background: #fff1cf;
  color: #76500f;
  font-size: .7rem;
  font-weight: 750;
}

@media (max-width: 620px) {
  .source-data-warning {
    align-items: flex-start;
    flex-direction: column;
  }
}

.score-help {
  max-width: 760px;
  margin: -.5rem 0 1.25rem;
  color: var(--app-muted);
  font-size: .85rem;
}

.opportunity-list {
  margin: 12px -24px -24px;
  display: grid;
}

.opportunity-row {
  padding: 17px 24px;
  border-top: 1px solid var(--app-line);
  color: var(--app-ink);
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(180px, 1fr) auto;
  gap: 20px;
  align-items: center;
  text-decoration: none;
}

.opportunity-row:hover {
  background: #f8faf9;
}

.opportunity-row:focus-visible {
  outline: 3px solid rgba(22, 89, 90, .2);
  outline-offset: -3px;
}

.opportunity-row div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.opportunity-row span,
.opportunity-row small {
  color: var(--app-muted);
}

.status {
  width: max-content;
  max-width: 100%;
  padding: 5px 10px;
  border-radius: 999px;
  background: #eef1f0;
  color: #53615f;
  display: inline-flex;
  align-items: center;
  font-size: .78rem;
  font-weight: 700;
  line-height: 1.2;
}

.status-new {
  background: #e8f1ff;
  color: #285a94;
}

.status-reviewing {
  background: #fff4d6;
  color: #755500;
}

.status-pursuing,
.status-active {
  background: #dff4e9;
  color: #19613c;
}

.status-dismissed {
  background: #f1eeee;
  color: #725f5f;
}

.empty-state {
  padding: 42px 18px;
  text-align: center;
}

.filter-bar {
  margin-bottom: 18px;
  display: flex;
  align-items: end;
  gap: 14px;
}

.filter-bar label {
  color: var(--app-muted);
  display: grid;
  gap: 5px;
  font-size: .82rem;
}

.filter-bar .form-select {
  min-width: 190px;
}

.pagination-row {
  padding-top: 24px;
  display: flex;
  justify-content: center;
  gap: 24px;
}

.detail-heading {
  margin-top: 18px;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
}

.detail-grid > div {
  display: grid;
  gap: 20px;
}

.decision-card {
  position: sticky;
  top: 84px;
}

.decision-card form {
  display: grid;
  gap: 16px;
}

.decision-card label {
  color: var(--app-muted);
  display: grid;
  gap: 6px;
  font-size: .85rem;
}

.detail-list {
  margin: 18px 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.detail-list div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.detail-list dt {
  color: var(--app-muted);
  font-size: .78rem;
}

.detail-list dd {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.reason-list,
.item-list,
.member-list {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.reason-list li,
.item-list > div,
.member-list li {
  padding-top: 12px;
  border-top: 1px solid var(--app-line);
  display: grid;
  gap: 3px;
}

.reason-list span,
.item-list span,
.item-list small,
.member-list span {
  color: var(--app-muted);
  font-size: .84rem;
}

.member-list li > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.member-list strong {
  overflow-wrap: anywhere;
}

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

.monitor-card ul {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.monitor-card li {
  padding: 10px 0;
  border-top: 1px solid var(--app-line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.monitor-card li strong {
  color: #19613c;
  font-size: .78rem;
}

.monitor-card li em {
  color: #8a6510;
  font-size: .78rem;
}

.monitor-meta {
  color: var(--app-muted);
  font-size: .84rem;
}

.opportunity-page-heading {
  margin-bottom: 20px;
}

.opportunity-summary-grid,
.opportunity-value-grid {
  margin-bottom: 22px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.opportunity-summary-grid article,
.opportunity-value-grid article {
  min-width: 0;
  padding: 18px 20px;
  border: 1px solid var(--app-line);
  border-radius: 14px;
  background: #fff;
  display: grid;
  align-content: start;
  gap: 6px;
}

.opportunity-summary-grid .summary-highlight,
.opportunity-value-grid .summary-highlight {
  border-color: #b7d8ce;
  background: #eef8f4;
}

.opportunity-summary-grid span,
.opportunity-value-grid span {
  color: var(--app-muted);
  font-size: .78rem;
  font-weight: 700;
}

.opportunity-summary-grid strong,
.opportunity-value-grid strong {
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.opportunity-summary-grid small,
.opportunity-value-grid small {
  color: var(--app-muted);
  font-size: .72rem;
}

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

.opportunity-tabs {
  margin-bottom: 14px;
  padding: 4px;
  border: 1px solid var(--app-line);
  border-radius: 12px;
  background: #fff;
  display: flex;
  gap: 3px;
  overflow-x: auto;
}

.opportunity-tabs a {
  flex: 0 0 auto;
  padding: 9px 14px;
  border-radius: 8px;
  color: var(--app-muted);
  font-size: .84rem;
  font-weight: 700;
  text-decoration: none;
}

.opportunity-tabs a:hover,
.opportunity-tabs a.active {
  background: var(--app-accent);
  color: var(--app-brand-dark);
}

.opportunity-filter-disclosure {
  margin-bottom: 18px;
}

.opportunity-filter-disclosure > summary {
  display: none;
}

.opportunity-filter-panel {
  margin-bottom: 0;
  padding: 18px;
  border: 1px solid var(--app-line);
  border-radius: 14px;
  background: #fff;
}

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

.filter-grid label {
  min-width: 0;
  color: var(--app-muted);
  display: grid;
  gap: 5px;
  font-size: .76rem;
  font-weight: 700;
}

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

.opportunity-results {
  display: grid;
  gap: 12px;
}

.opportunity-card {
  border: 1px solid var(--app-line);
  border-radius: 14px;
  background: #fff;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  overflow: hidden;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.opportunity-card:hover {
  border-color: #b8cec7;
  box-shadow: 0 10px 30px rgba(23, 52, 53, .07);
}

.opportunity-card-main {
  min-width: 0;
  padding: 20px 22px;
}

.opportunity-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.opportunity-card-heading > div {
  min-width: 0;
}

.opportunity-card-heading h2 {
  margin: 7px 0 4px;
  font-size: 1.08rem;
  line-height: 1.35;
}

.opportunity-card-heading h2 a {
  color: var(--app-ink);
  text-decoration: none;
}

.opportunity-card-heading h2 a:hover {
  color: var(--app-brand);
  text-decoration: underline;
}

.opportunity-card-heading p,
.opportunity-card-footer p {
  margin: 0;
  color: var(--app-muted);
  font-size: .86rem;
}

.opportunity-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.monitor-count-badge,
.company-opportunity-badge {
  padding: 5px 8px;
  border: 1px solid #c8d4e7;
  border-radius: 999px;
  background: #f0f4fa;
  color: #40567a;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .02em;
}

.company-opportunity-badge {
  border-color: #afd2c8;
  background: var(--app-accent);
  color: var(--app-brand-dark);
}

.detail-badges {
  margin-top: 12px;
}

.fit-badge,
.eligibility-badge,
.confidence-badge {
  width: max-content;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .03em;
  line-height: 1.2;
  text-transform: uppercase;
}

.fit-high,
.confidence-high {
  background: #dff4e9;
  color: #19613c;
}

.fit-medium,
.confidence-medium {
  background: #fff1c9;
  color: #765500;
}

.fit-low,
.confidence-low {
  background: #eef1f0;
  color: #586764;
}

.eligibility-badge {
  background: #e8f1ff;
  color: #285a94;
}

.opportunity-commercial-grid {
  margin: 18px 0 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.opportunity-commercial-grid > div {
  min-width: 0;
  padding: 12px 14px;
  border-left: 3px solid var(--app-line);
  background: #f8faf9;
  display: grid;
  gap: 3px;
}

.opportunity-commercial-grid dt {
  color: var(--app-muted);
  font-size: .72rem;
  font-weight: 700;
}

.opportunity-commercial-grid dd {
  margin: 0;
  font-size: .98rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.opportunity-commercial-grid small {
  color: var(--app-muted);
  font-size: .7rem;
}

.opportunity-commercial-grid .aligned-value {
  border-left-color: #3d8c77;
  background: #eef8f4;
}

.deadline-urgent {
  border-left-color: #c75843 !important;
}

.deadline-urgent dt,
.deadline-text.deadline-urgent {
  color: #9a3828;
}

.deadline-soon {
  border-left-color: #d09a28 !important;
}

.deadline-soon dt,
.deadline-text.deadline-soon {
  color: #806015;
}

.opportunity-card-footer {
  padding-top: 13px;
  border-top: 1px solid var(--app-line);
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.opportunity-card-footer p:last-child {
  text-align: right;
}

.opportunity-card-action {
  min-width: 154px;
  padding: 18px;
  border-left: 1px solid var(--app-line);
  color: var(--app-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: .86rem;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.opportunity-card-action:hover {
  background: var(--app-accent);
  color: var(--app-brand-dark);
}

.detail-status-stack {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.deadline-text {
  color: var(--app-brand);
  font-size: .82rem;
  white-space: nowrap;
}

.process-timeline {
  margin: 22px 0 26px;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.process-timeline li {
  position: relative;
  min-width: 0;
  padding: 18px 14px 0 0;
  border-top: 3px solid var(--app-line);
  display: grid;
  gap: 4px;
}

.process-timeline li::before {
  position: absolute;
  top: -7px;
  left: 0;
  width: 11px;
  height: 11px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #afbfbb;
  box-shadow: 0 0 0 1px #afbfbb;
  content: "";
}

.process-timeline li.complete,
.process-timeline li.current {
  border-color: #6cae9c;
}

.process-timeline li.complete::before,
.process-timeline li.current::before {
  background: var(--app-brand);
  box-shadow: 0 0 0 1px var(--app-brand);
}

.process-timeline span {
  color: var(--app-muted);
  font-size: .75rem;
}

.process-timeline strong {
  font-size: .82rem;
  overflow-wrap: anywhere;
}

.matched-item-list {
  margin-top: 18px;
  display: grid;
}

.matched-item-list article {
  padding: 14px 0;
  border-top: 1px solid var(--app-line);
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.matched-item-list article > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.matched-item-list span,
.matched-item-list small {
  color: var(--app-muted);
  font-size: .78rem;
}

.matched-item-list article > strong {
  flex: 0 0 auto;
  color: var(--app-brand-dark);
}

.requested-items-heading > div:first-child {
  max-width: 620px;
}

.requested-items-heading p,
.requested-items-disclaimer {
  margin: 0;
  color: var(--app-muted);
  font-size: .84rem;
}

.requested-items-summary {
  min-width: 210px;
  display: grid;
  justify-items: end;
  gap: 4px;
  color: var(--app-muted);
  font-size: .78rem;
  text-align: right;
}

.requested-items-summary span:not(.confidence-badge) {
  display: block;
}

.requested-items-summary strong {
  color: var(--app-brand-dark);
  font-size: .9rem;
}

.requested-items-summary .confidence-badge {
  margin-top: 4px;
}

.requested-items-disclaimer {
  max-width: 760px;
  margin-top: 14px;
}

.requested-item-toolbar {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.requested-item-filters {
  padding: 3px;
  border: 1px solid var(--app-line);
  border-radius: 10px;
  background: #f4f7f6;
  display: inline-flex;
  gap: 3px;
}

.requested-item-filters button {
  min-height: 34px;
  padding: 6px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--app-muted);
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
}

.requested-item-filters button span {
  min-width: 22px;
  margin-left: 4px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(15, 91, 85, .09);
  color: var(--app-brand-dark);
  font-size: .7rem;
}

.requested-item-filters button.active {
  background: #fff;
  color: var(--app-brand-dark);
  box-shadow: 0 1px 4px rgba(20, 54, 52, .12);
}

.requested-item-filters button:focus-visible {
  outline: 3px solid rgba(22, 89, 90, .24);
  outline-offset: 2px;
}

.requested-item-filter-status {
  color: var(--app-muted);
  font-size: .76rem;
}

.item-alignment-note {
  margin-top: 18px;
  padding: 13px 14px;
  border: 1px solid #d9dfeb;
  border-radius: 10px;
  background: #f6f7fb;
  display: grid;
  gap: 3px;
}

.item-alignment-note strong {
  font-size: .84rem;
}

.item-alignment-note span {
  color: var(--app-muted);
  font-size: .78rem;
}

.requested-item-list {
  margin-top: 18px;
  display: grid;
  gap: 9px;
}

.requested-item {
  min-width: 0;
  padding: 14px 16px 14px 12px;
  border: 1px solid var(--app-line);
  border-left: 4px solid transparent;
  border-radius: 11px;
  background: #fff;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}

.requested-item[hidden] {
  display: none;
}

.requested-item-aligned {
  border-color: #acd3c5;
  border-left-color: var(--app-brand);
  background: #f2faf7;
  box-shadow: 0 3px 12px rgba(15, 91, 85, .07);
}

.requested-item-marker {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #fff;
  display: inline-grid;
  place-items: center;
  font-size: .82rem;
  font-weight: 900;
}

.requested-item-aligned .requested-item-marker {
  background: var(--app-brand);
}

.requested-item-content {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.requested-item-title {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
}

.requested-item-title > strong {
  overflow-wrap: anywhere;
}

.aligned-item-badge {
  padding: 3px 7px;
  border: 1px solid #9bc9b8;
  border-radius: 999px;
  background: #dff3eb;
  color: var(--app-brand-dark);
  font-size: .66rem;
  font-weight: 850;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.requested-item-description,
.requested-item-quantity,
.requested-item-value span,
.alignment-evidence small {
  color: var(--app-muted);
  font-size: .78rem;
}

.alignment-evidence {
  margin-top: 5px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.alignment-label {
  padding: 4px 7px;
  border-radius: 7px;
  background: var(--app-accent);
  color: var(--app-brand-dark);
  font-size: .72rem;
  font-weight: 700;
}

.requested-item-value {
  min-width: 135px;
  display: grid;
  justify-items: end;
  gap: 3px;
  text-align: right;
}

.requested-item-value strong {
  color: var(--app-ink);
  font-size: .86rem;
}

.requested-item-aligned .requested-item-value strong {
  color: var(--app-brand-dark);
}

.app-body .form-control {
  width: 100%; min-height: 2.65rem; padding: .62rem .75rem;
  border: 1px solid #afbfbb; border-radius: .62rem;
  background: #fff; color: var(--app-ink);
}

.app-body textarea.form-control { min-height: 5.5rem; resize: vertical; }
.app-body .form-control:focus, .app-body .form-select:focus {
  border-color: var(--app-brand); box-shadow: 0 0 0 3px rgba(15, 91, 85, .12); outline: 0;
}

.heading-actions, .monitor-card-actions, .sticky-form-actions {
  display: flex; align-items: center; gap: 10px;
}

.monitor-explainer {
  margin-bottom: 22px; display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(440px, 1fr);
  align-items: center; gap: 28px;
}
.monitor-explainer h2, .monitor-explainer p { margin: 0; }
.score-legend { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.score-legend div { padding: 12px; border: 1px solid var(--app-line); border-radius: 10px; background: #f8fbfa; }
.score-legend dt { color: var(--app-brand); font-size: 1.2rem; font-weight: 800; }
.score-legend dd { margin: 3px 0 0; color: var(--app-muted); font-size: .76rem; }
.score-legend-vertical { grid-template-columns: 1fr 1fr; }

.monitor-card-rich { display: grid; align-content: start; gap: 18px; }
.monitor-card-rich h2 a { color: var(--app-ink); text-decoration: none; }
.monitor-card-rich h2 a:hover { color: var(--app-brand); }
.monitor-summary-grid {
  margin: 0; padding: 14px 0; border-top: 1px solid var(--app-line);
  border-bottom: 1px solid var(--app-line); display: grid;
  grid-template-columns: 1fr 1fr; gap: 14px;
}
.monitor-summary-grid div { display: grid; gap: 2px; }
.monitor-summary-grid dt { color: var(--app-muted); font-size: .73rem; }
.monitor-summary-grid dd { margin: 0; font-size: .9rem; font-weight: 700; }
.monitor-label-summary, .rule-chip-list { display: flex; flex-wrap: wrap; gap: 7px; }
.rule-chip { padding: 5px 9px; border: 1px solid #bcdad3; border-radius: 999px; background: #eef8f5; color: #16564f; font-size: .75rem; }
.rule-chip-exclude { border-color: #e8c7c1; background: #fff4f1; color: #884436; }
.rule-chip-code { border-color: #cbd2ea; background: #f2f4fb; color: #3f4d82; }
.rule-chip-muted { opacity: .55; }
.monitor-card-actions { margin-top: auto; }

.monitor-detail-grid { grid-template-columns: minmax(0, 1.7fr) minmax(270px, .8fr); }
.rule-list, .revision-list, .compact-match-list, .preview-match-list { display: grid; gap: 10px; }
.rule-card { border: 1px solid var(--app-line); border-radius: 12px; background: #fff; overflow: hidden; }
.rule-card summary { padding: 15px 16px; display: flex; align-items: center; justify-content: space-between; gap: 18px; cursor: pointer; }
.rule-card summary > span:first-child { display: grid; gap: 3px; }
.rule-card summary small, .compact-match-list small, .revision-list small, .preview-match-list span { color: var(--app-muted); font-size: .78rem; }
.rule-card-body { padding: 4px 16px 18px; border-top: 1px solid var(--app-line); display: grid; gap: 18px; }
.rule-card-body h3, .preview-rule-summary h2 { margin: 14px 0 8px; font-size: .92rem; }
.source-product-list { margin: 0; padding-left: 18px; }
.source-product-list small { color: var(--app-muted); }
.compact-match-list a, .revision-list > div, .preview-match-list article {
  padding: 12px 0; border-top: 1px solid var(--app-line); color: var(--app-ink);
  display: flex; justify-content: space-between; align-items: center; gap: 16px; text-decoration: none;
}
.compact-match-list a > span:first-child, .revision-list > div > span, .preview-match-list article > div { min-width: 0; display: grid; gap: 3px; }
.compact-match-list strong, .preview-match-list strong { overflow-wrap: anywhere; }
.historical-match-heading {
  border-top: 1px solid var(--app-line);
  margin-top: 1.25rem;
  padding-top: 1.25rem;
}
.single-column { grid-template-columns: 1fr; }

.reason-list-scored li { grid-template-columns: auto 1fr; align-items: start; gap: 12px; }
.reason-list-scored .reason-points { min-width: 42px; padding: 5px 7px; border-radius: 8px; background: var(--app-accent); color: var(--app-brand-dark); font-weight: 800; text-align: center; }
.reason-list-scored li > span:last-child { display: grid; gap: 3px; }
.excluded-rule-detail { margin-top: 16px; color: var(--app-muted); font-size: .84rem; }

.monitor-evidence-list {
  display: grid;
  gap: 12px;
}

.monitor-evidence-list > article {
  padding: 15px 16px;
  border: 1px solid var(--app-line);
  border-radius: 12px;
  background: #f9fbfa;
}

.monitor-evidence-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.monitor-evidence-heading > div {
  display: grid;
  gap: 3px;
}

.monitor-evidence-heading > div:last-child {
  justify-items: end;
  color: var(--app-muted);
  font-size: .76rem;
  text-align: right;
}

.monitor-evidence-heading small {
  color: var(--app-muted);
  font-size: .72rem;
}

.monitor-evidence-heading a {
  color: var(--app-brand);
  font-weight: 700;
  text-decoration: none;
}

.monitor-evidence-list .reason-list {
  margin-top: 12px;
}

.opportunity-card-footer p > small {
  margin-top: 4px;
  color: var(--app-muted);
  display: block;
  font-size: .75rem;
}

.alignment-monitors {
  flex-basis: 100%;
}

.monitor-editor { display: grid; gap: 20px; }
.notification-settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, .7fr);
  gap: 20px;
  align-items: start;
}
.notification-form, .notification-fieldset { display: grid; gap: 12px; }
.notification-form { margin-top: 18px; gap: 22px; }
.notification-fieldset { margin: 0; padding: 0; border: 0; }
.notification-fieldset legend { margin-bottom: 8px; font-weight: 800; }
.notification-fieldset ul { margin: 0; padding: 0; display: grid; gap: 9px; list-style: none; }
.notification-fieldset label { display: flex; align-items: center; gap: 9px; }
.notification-fieldset small { color: var(--app-muted); }
.notification-explainer ol { margin: 16px 0; padding-left: 22px; display: grid; gap: 12px; }
.notification-preview { margin-top: 20px; }
.notification-preview-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.notification-preview-heading h2 { margin: 0; }
.notification-preview-company + .notification-preview-company { margin-top: 24px; }
.notification-preview-company h3 { margin: 22px 0 4px; }
.monitor-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-field { color: var(--app-ink); display: grid; align-content: start; gap: 6px; font-size: .84rem; font-weight: 700; }
.form-field-wide { grid-column: 1 / -1; }
.form-field small, .delete-rule, .check-field { color: var(--app-muted); font-size: .76rem; font-weight: 400; }
.form-field .errorlist, .form-errors .errorlist { margin: 0; padding-left: 18px; color: #9b382c; font-weight: 600; }
.check-field, .delete-rule { display: flex; align-items: center; gap: 8px; }
.check-field.compact { justify-self: end; }
.rule-editor { padding: 18px; border: 1px solid var(--app-line); border-radius: 14px; background: #f9fbfa; }
.rule-editor + .rule-editor { margin-top: 14px; }
.delete-rule { margin-top: 14px; color: #884436; }
.sticky-form-actions {
  position: sticky; bottom: 14px; z-index: 5; padding: 14px 16px;
  border: 1px solid #cddbd7; border-radius: 14px; background: rgba(255, 255, 255, .96);
  box-shadow: 0 12px 35px rgba(20, 54, 52, .13); justify-content: space-between;
}
.sticky-form-actions p { margin: 0; font-size: .84rem; }
.monitor-preview-grid { grid-template-columns: minmax(0, 1.6fr) minmax(270px, .7fr); }

.app-auth-content {
  min-height: 100vh;
}

@media (max-width: 900px) {
  .notification-settings-grid { grid-template-columns: 1fr; }
  .app-layout {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: fixed;
    z-index: 40;
    width: min(82vw, 290px);
    transform: translateX(-100%);
    transition: transform .2s ease;
    box-shadow: 18px 0 50px rgba(5, 28, 28, .22);
  }

  .app-menu-open {
    overflow: hidden;
  }

  .app-menu-open .app-sidebar {
    transform: translateX(0);
  }

  .app-menu-open .app-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: block;
    border: 0;
    background: rgba(8, 31, 31, .46);
    cursor: pointer;
  }

  .app-menu-close {
    display: inline-grid;
    place-items: center;
  }

  .app-topbar {
    padding: 0 18px;
    justify-content: space-between;
  }

  .app-menu-toggle {
    width: 2.6rem;
    height: 2.6rem;
    padding: 0;
    border: 1px solid var(--app-line);
    border-radius: .65rem;
    background: #fff;
    color: var(--app-ink);
    display: inline-grid;
    place-items: center;
    font-size: 1.25rem;
    cursor: pointer;
  }

  .app-context-switchers {
    min-width: 0;
    flex: 1;
    gap: 6px;
  }

  .company-switcher {
    min-width: 0;
    flex: 1 1 auto;
  }

  .company-switcher summary {
    width: 100%;
    min-width: 0;
    max-width: 220px;
  }

  .workspace-context-switcher summary {
    width: 112px;
    min-width: 0;
  }

  .account-switcher summary {
    width: 44px;
    min-width: 44px;
    height: 42px;
    padding: 0;
    justify-content: center;
  }

  .account-switcher summary::after,
  .account-label {
    display: none;
  }

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

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

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

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

  .company-navigation {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .company-navigation-links {
    overflow-x: auto;
  }

  .company-navigation-links a {
    flex: 1 0 auto;
    text-align: center;
  }

  .monitor-explainer,
  .monitor-detail-grid,
  .monitor-preview-grid {
    grid-template-columns: 1fr;
  }

  .decision-card {
    position: static;
  }

  .monitor-grid,
  .organization-grid {
    grid-template-columns: 1fr;
  }

  .company-setup-steps {
    grid-template-columns: 1fr;
  }

  .company-monitor-health {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

@media (max-width: 620px) {
  .app-topbar {
    padding: 0 12px;
    gap: 8px;
  }

  .switcher-prefix {
    display: none;
  }

  .company-switcher summary {
    max-width: none;
  }

  .company-switcher .workspace-menu {
    right: auto;
    left: 0;
  }

  .workspace-context-switcher summary {
    width: 86px;
  }

  .workspace-switcher summary {
    padding-left: .58rem;
    padding-right: 1.6rem;
  }

  .account-switcher summary {
    padding: 0;
  }

  .app-content,
  .app-flashes {
    padding: 22px 16px;
  }

  .app-flashes {
    padding-bottom: 0;
  }

  .app-auth-flashes {
    padding: 16px 12px 0;
  }

  .app-page-heading {
    display: grid;
    gap: 14px;
  }

  .detail-heading h1 {
    font-size: 1.75rem;
    line-height: 1.16;
  }

  .metric-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .metric-grid article {
    padding: 16px;
  }

  .opportunity-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .filter-bar {
    display: grid;
  }

  .filter-bar label,
  .filter-bar .form-select,
  .filter-bar .btn {
    width: 100%;
  }

  .detail-list {
    grid-template-columns: 1fr;
  }

  .opportunity-summary-grid,
  .opportunity-value-grid,
  .filter-grid,
  .opportunity-commercial-grid,
  .process-timeline {
    grid-template-columns: 1fr;
  }

  .opportunity-summary-grid {
    grid-template-columns: 1fr 1fr;
  }

  .opportunity-filter-panel {
    padding: 14px;
  }

  .opportunity-filter-disclosure {
    border: 1px solid var(--app-line);
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
  }

  .opportunity-filter-disclosure > summary {
    padding: 15px 16px;
    color: var(--app-ink);
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-weight: 800;
    cursor: pointer;
  }

  .opportunity-filter-disclosure > summary span {
    color: var(--app-muted);
    font-size: .72rem;
    font-weight: 400;
    text-align: right;
  }

  .opportunity-filter-disclosure[open] > summary {
    border-bottom: 1px solid var(--app-line);
  }

  .opportunity-filter-disclosure .opportunity-filter-panel {
    border: 0;
    border-radius: 0;
  }

  .filter-actions,
  .opportunity-card-footer,
  .matched-item-list article {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-actions .btn {
    width: 100%;
  }

  .opportunity-card {
    grid-template-columns: 1fr;
  }

  .opportunity-card-main {
    padding: 18px 16px;
  }

  .opportunity-card-heading {
    display: grid;
  }

  .opportunity-card-heading .status {
    grid-row: 1;
  }

  .opportunity-card-footer p:last-child {
    text-align: left;
  }

  .opportunity-card-action {
    min-width: 0;
    padding: 14px 16px;
    border-top: 1px solid var(--app-line);
    border-left: 0;
  }

  .detail-status-stack {
    justify-items: start;
  }

  .heading-actions,
  .sticky-form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .sticky-form-actions {
    position: static;
  }

  .heading-actions .btn,
  .sticky-form-actions .btn {
    width: 100%;
  }

  .monitor-form-grid {
    grid-template-columns: 1fr;
  }

  .score-legend {
    grid-template-columns: 1fr 1fr;
  }

  .form-field-wide {
    grid-column: auto;
  }

  .rule-card summary {
    align-items: flex-start;
  }

  .monitor-evidence-heading {
    display: grid;
  }

  .monitor-evidence-heading > div:last-child {
    justify-items: start;
    text-align: left;
  }

  .process-timeline li {
    padding: 0 0 18px 24px;
    border-top: 0;
    border-left: 3px solid var(--app-line);
  }

  .process-timeline li::before {
    top: 0;
    left: -7px;
  }

  .matched-item-list article > strong {
    flex-basis: auto;
  }

  .requested-items-heading,
  .requested-item-toolbar {
    display: grid;
  }

  .requested-items-summary {
    min-width: 0;
    justify-items: start;
    text-align: left;
  }

  .requested-item-filters {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .requested-item {
    grid-template-columns: 26px minmax(0, 1fr);
    padding: 13px 13px 13px 10px;
    gap: 10px;
  }

  .requested-item-value {
    min-width: 0;
    padding-top: 8px;
    border-top: 1px solid rgba(102, 118, 116, .18);
    grid-column: 2;
    justify-items: start;
    text-align: left;
  }

  .pagination-row {
    gap: 14px;
    font-size: .88rem;
  }
}
