/* screener.html -- filter/sort table over data/homepage_snapshot.json (the
   same digest index.html's dashboard uses). Reuses the site's white-card /
   var(--color-border)-border / 8px-radius language (see css/company.css's quickstat
   cards, css/watchlist.css's table) rather than introducing new visual
   language for a single page. */

body {
  background: var(--color-bg);
  color: var(--color-text);
}

.screener-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.2em 1.2em 5em 1.2em;
}

.screener-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1em;
  flex-wrap: wrap;
  margin-bottom: 0.6em;
}

.screener-page-title {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--brand-ink);
  letter-spacing: -0.01em;
  margin: 0 0 0.25em 0;
}

.screener-page-subtitle {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  margin: 0;
}

.screener-page-count {
  flex: 0 0 auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 0.45em 1em;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brand-blue);
  white-space: nowrap;
}

.screener-coverage-note {
  color: var(--color-text-muted);
  font-size: 0.82rem;
  margin: 0 0 1.4em 0;
}

.screener-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1em 1.4em;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(20, 30, 50, .04);
  padding: 1.2em 1.4em;
  margin-bottom: 1.6em;
}

.screener-filter {
  display: flex;
  flex-direction: column;
  gap: 0.4em;
}

.screener-filter label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}

.screener-filter select {
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 0.5em 0.6em;
  font-size: 0.92rem;
  color: var(--brand-ink);
  background: var(--color-surface);
  min-width: 12em;
}

.screener-range-inputs {
  display: flex;
  align-items: center;
  gap: 0.4em;
  color: var(--color-text-muted);
}

.screener-range-inputs input {
  width: 5.5em;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 0.5em 0.6em;
  font-size: 0.92rem;
  color: var(--brand-ink);
}

.screener-reset-btn {
  align-self: center;
  background: var(--brand-blue-soft);
  color: var(--brand-blue);
  border: none;
  border-radius: 20px;
  padding: 0.6em 1.2em;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.screener-reset-btn:hover {
  background: var(--color-surface-tint);
}

.screener-table-wrapper {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(20, 30, 50, .04);
  overflow-x: auto;
}

.screener-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.screener-table thead th {
  text-align: left;
  padding: 0.85em 1em;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  background: var(--color-surface-soft);
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}

.screener-table thead th:hover {
  color: var(--brand-blue);
}

.screener-table td {
  padding: 0.85em 1em;
  border-bottom: 1px solid var(--color-surface-tint);
  vertical-align: middle;
  white-space: nowrap;
}

.screener-table tbody tr:hover {
  background: var(--color-surface-soft);
}

.screener-table tbody tr:last-of-type td {
  border-bottom: none;
}

.screener-col-right {
  text-align: right;
}

.screener-col-left {
  text-align: left;
}

.screener-ticker-cell a {
  font-weight: 700;
  color: var(--brand-blue);
  letter-spacing: 0.01em;
  text-decoration: none;
}

.screener-ticker-cell a:hover {
  text-decoration: underline;
}

.screener-table .is-positive { color: var(--color-positive); }
.screener-table .is-negative { color: var(--color-negative); }

.screener-empty-state {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(20, 30, 50, .04);
  padding: 3em 1.5em;
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 0.95rem;
}

@media (max-width: 640px) {
  .screener-filters {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
  }

  .screener-filter select {
    min-width: 0;
  }

  .screener-reset-btn {
    align-self: stretch;
  }
}
