.scanner-quick-filters {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  overflow: visible;
  padding: 2px 1px 4px;
}

.scanner-filter {
  min-width: 0;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid var(--atlas-border);
  border-radius: 999px;
  background: var(--atlas-surface-subtle);
  color: var(--atlas-text-secondary);
  font-weight: 850;
}

.scanner-filter[aria-pressed="true"] {
  border-color: var(--atlas-gold);
  color: var(--atlas-gold-bright);
  background: rgba(232, 185, 94, .1);
  box-shadow: inset 0 0 0 1px rgba(232, 185, 94, .12);
}

.scanner-filter:focus-visible,
.opportunity-card button:focus-visible {
  outline: 2px solid var(--atlas-gold-bright);
  outline-offset: 2px;
}

.best-opportunities {
  margin-top: 11px;
  padding: 13px;
}

.best-opportunities > h2 {
  margin: 0 0 10px;
  color: var(--atlas-gold);
  font-size: .79rem;
  letter-spacing: .13em;
  text-transform: uppercase;
}

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

.opportunity-card {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--atlas-border);
  border-left: 3px solid var(--atlas-wait);
  border-radius: var(--atlas-radius-md);
  background: var(--atlas-surface-subtle);
}

.opportunity-card.best-now-hero {
  grid-column: 1 / -1;
  border-color: color-mix(in srgb, var(--atlas-positive) 52%, var(--atlas-border));
  border-left: 4px solid var(--atlas-positive);
  background: linear-gradient(112deg, rgba(67, 201, 139, .13), var(--atlas-surface-subtle) 58%);
  box-shadow: 0 0 0 1px rgba(67, 201, 139, .08);
}

.opportunity-card.unavailable {
  border-left-color: var(--atlas-info);
  color: var(--atlas-text-muted);
}

.opportunity-card.best-now-unavailable {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 3px 10px;
  padding: 8px 10px;
}

.opportunity-card.compact-unavailable {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  padding: 7px 9px;
}

.opportunity-slot {
  color: var(--atlas-text-muted);
  font-size: .61rem;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.opportunity-identity {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: baseline;
  min-width: 0;
}

.opportunity-identity strong {
  color: var(--atlas-text);
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.opportunity-identity span {
  color: var(--atlas-text-secondary);
  font-size: .68rem;
  font-weight: 850;
  text-transform: uppercase;
}

.opportunity-decision {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 9px;
  color: var(--atlas-text-secondary);
  font-size: .7rem;
  font-weight: 800;
}

.opportunity-decision strong {
  color: var(--atlas-gold-bright);
}

.opportunity-reason {
  margin: 0;
  color: var(--atlas-text-secondary);
  font-size: .71rem;
  line-height: 1.35;
}

.opportunity-actionability {
  width: fit-content;
  color: var(--atlas-invalid);
  font-size: .65rem;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.opportunity-unavailable-message {
  min-width: 0;
  color: var(--atlas-text-secondary);
  font-size: .74rem;
  line-height: 1.25;
}

.opportunity-card.best-now-unavailable .opportunity-unavailable-message {
  color: var(--atlas-text);
  text-transform: uppercase;
}

.opportunity-card .opportunity-reason {
  grid-column: 1 / -1;
}

.opportunity-card button {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--atlas-gold-bright);
  font-size: .7rem;
  font-weight: 900;
  text-align: left;
  cursor: pointer;
}

@media (min-width: 760px) {
  .opportunity-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .opportunity-card.best-now-hero,
  .opportunity-card.best-now-unavailable { grid-column: 1 / -1; }
}

@media (max-width: 759px) {
  .scanner-quick-filters {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 6px;
    overflow: visible;
    scrollbar-width: none;
  }

  .scanner-filter {
    width: 100%;
    min-width: 0;
    padding: 0 4px;
    font-size: .65rem;
    white-space: nowrap;
  }

  .scanner-filter:nth-child(-n + 3) { grid-column: span 4; }
  .scanner-filter:nth-child(4),
  .scanner-filter:nth-child(5) { grid-column: span 3; }
  .scanner-filter:nth-child(6) { grid-column: span 4; }
  .scanner-filter:nth-child(7) { grid-column: span 2; }

  .best-opportunities { padding: 10px; }
  .opportunity-grid { gap: 6px; }
  .opportunity-card { gap: 5px; padding: 8px; }
  .opportunity-card.best-now-unavailable { min-height: 48px; }
  .opportunity-card.compact-unavailable { min-height: 42px; }
  .opportunity-card.directional-opportunity { grid-column: 1 / -1; }
  .opportunity-card button { min-height: 44px; }
}

@media (max-width: 430px) {
  .opportunity-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .opportunity-card.best-now-hero,
  .opportunity-card.best-now-unavailable,
  .opportunity-card.directional-opportunity { grid-column: 1 / -1; }
  .opportunity-card.compact-unavailable { grid-column: span 1; }
  .opportunity-identity strong { font-size: .92rem; }
  .opportunity-decision { gap: 4px 7px; font-size: .66rem; }
}

@media (max-width: 360px) {
  .scanner-filter { font-size: .61rem; }
  .opportunity-card.best-now-unavailable { grid-template-columns: minmax(0, 1fr); }
  .opportunity-card.best-now-unavailable .opportunity-slot,
  .opportunity-card.best-now-unavailable .opportunity-reason { grid-column: 1 / -1; }
}
