/* Sources page — layers on style.css (same tokens, controls, topbar). */

/* Controls: the search bar takes the row, the filter button is just its icon,
   and the three filters live in the panel it opens — directly underneath. */
.src-controls { flex-wrap: wrap; }
.src-controls .search-wrap { flex: 1 1 auto; }
.src-filter-btn { position: relative; width: 44px; height: 44px; flex: 0 0 auto; }
.src-filter-btn.has-value { border-color: var(--accent); color: var(--accent); }
.src-filter-dot { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px;
  border-radius: var(--r-pill); background: var(--accent); }
.src-filters { flex: 1 0 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.src-filters[hidden] { display: none; }
.src-filter-clear { padding: 8px 16px; }

/* Custom menu — same pill, border, type and accent as every other control. */
.src-menu { position: relative; }
.src-menu .dd-btn { display: inline-flex; align-items: center; gap: 8px; height: var(--ctl-h);
  padding: 8px 16px; font-size: 14px; }
.src-menu .dd-btn svg { display: block; color: var(--text-faint); }
.src-menu[data-open] .dd-btn, .src-menu .dd-btn[aria-expanded="true"] { border-color: var(--accent); }
.src-menu-label { color: var(--text-soft); }
.src-menu-value { font-weight: 600; }
.src-menu-list { position: absolute; z-index: 40; top: calc(100% + 8px); left: 0; min-width: 100%;
  margin: 0; padding: 8px; list-style: none; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: 0 8px 24px rgba(17,24,39,.12); }
.src-menu-list[hidden] { display: none; }
.src-menu-list button { display: block; width: 100%; text-align: left; white-space: nowrap;
  font: inherit; font-size: 14px; color: var(--text); background: none; border: none;
  border-radius: var(--r-md); padding: 8px 16px; cursor: pointer; }
.src-menu-list button:hover { background: var(--bg-sunken); }
.src-menu-list button[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.src-page { padding: 24px var(--pad-x) 48px; }

/* Stat tiles: one row, 8px grid */
.src-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.src-stat { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-md); padding: 16px; }
.src-stat b { display: block; font-family: var(--font-head); font-size: 24px; font-weight: 600; letter-spacing: -0.01em; }
.src-stat span { font-size: 13px; color: var(--text-soft); }

/* Table — wide content scrolls inside its own frame, never the page */
.src-tablewrap { overflow-x: auto; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-lg); }
.src-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 880px; }
.src-table td:first-child { max-width: 260px; }
.src-table td:first-child { display: table-cell; }
.src-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.src-table th, .src-table td { padding: 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.src-table th { font-size: 12px; font-weight: 600; color: var(--text-soft); background: var(--bg); position: sticky; top: 0; white-space: nowrap; }
.src-table th.sortable { cursor: pointer; user-select: none; }
.src-table th.sortable:hover { color: var(--text); }
.src-table th.sortable:not(.sorted):hover::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 8px; opacity: .4;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.src-table th.sorted::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 8px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.src-table th.sorted.asc::after { transform: translateY(1px) rotate(225deg); }
.src-table td.num, .src-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.src-table tbody tr:last-child td { border-bottom: none; }
.src-table tbody tr:hover td { background: var(--bg-sunken); }
.src-name { font-weight: 600; color: var(--text); text-decoration: none; }
.src-name:hover { color: var(--accent); }
.src-sub { display: block; font-size: 12px; color: var(--text-faint); overflow-wrap: anywhere; }
.src-new-item .src-sub, .src-check .src-sub { margin-top: 8px; }
.src-table td { color: var(--text-soft); }
.src-table td.src-date { white-space: nowrap; color: var(--text); }
.src-table td.dim { color: var(--text-faint); }

/* Status chip in the "Checks" column — reuses .chip tints */
.src-check { display: inline-flex; flex-direction: column; gap: 4px; }
.src-check .chip { align-self: flex-start; }
.src-check .src-sub { margin-top: 0; white-space: nowrap; }

/* New hosts this week */
.src-new { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 24px; margin-bottom: 24px; }
.src-new-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.src-new h2 { font-family: var(--font-head); font-size: 16px; font-weight: 600; margin: 0 0 4px; }
.src-new-note { margin: 0; font-size: 13px; color: var(--text-soft); }
.src-new-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.src-new-item { border: 1px solid var(--border); border-radius: var(--r-md); padding: 16px; min-width: 0; }
.src-new-item .src-name { display: block; overflow-wrap: anywhere; }
.src-new-item .src-sub:first-of-type { margin-top: 8px; }
.src-feat { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Candidate platforms */
.src-cands { margin-top: 32px; }
.src-cands h2 { font-family: var(--font-head); font-size: 16px; font-weight: 600; margin: 0 0 4px; }
.src-cands-note { margin: 0 0 16px; font-size: 13px; color: var(--text-soft); }

@media (max-width: 640px) {
  .src-page { padding: 16px var(--pad-x) 32px; }
  .src-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .src-stat b { font-size: 20px; }
  .src-new { padding: 16px; }
  .src-new-head { flex-direction: column; }
  .src-table th, .src-table td { padding: 12px; }
}
/* Phones: the two pill groups are wider than the screen — each scrolls inside
   its own pill instead of pushing the page sideways. */
@media (max-width: 640px) {
  .controls .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .controls .seg::-webkit-scrollbar { display: none; }
  .controls .seg .seg-btn { flex: 0 0 auto; }
}
