/* Commons product overrides only. Shared primitives (.inline-row, .sort-card,
   .help-text, .empty-state, .badge, .entity-switcher, .btn-xs/.btn-sm, etc.)
   live in narratory-spa.css — do not re-declare them here (design_standards.md). */

.landing-card { height: 100%; }
.entity-switcher-bar { margin-bottom: 1rem; }

/* Browse/Sources result cards: a touch of spacing between stacked items. */
#sources-list .sort-card,
#filters-list .sort-card,
#browse-results .sort-card { margin-bottom: 0.5rem; }

/* --- Filter predicate editor: type-aware multi-select ---------------------- */
.ms-field { margin: 0.4rem 0 0.7rem; }
.ms-fieldlabel { font-size: 0.85rem; font-weight: 600; text-transform: capitalize; margin-bottom: 0.2rem; }

/* Inline checkbox chips (small bounded sets: gates, closed dims, lifecycle). */
.ms-checks { display: flex; flex-wrap: wrap; gap: 0.3rem 0.9rem; }
.ms-check { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.9rem; margin: 0; cursor: pointer; }
/* Restore the native checkbox glyph + a fixed square: a global `appearance: none`
   (mobile form reset / Pico) otherwise strips it, so the box vanishes — worst on iOS
   Safari. Explicit size + flex:0 0 auto stops the flex label from collapsing it. */
.ms-check input[type="checkbox"] {
  appearance: auto;
  -webkit-appearance: checkbox;
  margin: 0;
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
}

/* Searchable multi-select (large/growing sets + funder). */
.ms { position: relative; }
.ms-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 0.25rem; }
.ms-chip { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.1rem 0.5rem;
    background: #eef1f4; border: 1px solid #d4dae0; border-radius: 999px; font-size: 0.85rem; }
.ms-x { border: 0; background: none; padding: 0; cursor: pointer; line-height: 1; font-size: 0.85rem; color: #667; }
.ms-x:hover { color: #c0392b; }
.ms-input { width: 100%; }
.ms-menu { position: absolute; left: 0; right: 0; z-index: 30; max-height: 14rem; overflow-y: auto;
    background: #fff; border: 1px solid #ccc; border-radius: 6px; box-shadow: 0 4px 14px rgba(0,0,0,0.1); margin-top: 2px; }
.ms-opt { padding: 0.35rem 0.6rem; cursor: pointer; font-size: 0.9rem; }
.ms-opt:hover { background: #eef1f4; }
/* #116 hierarchical geo picker: nested region rows + country expander rows. */
.ms-opt-sub { padding-left: 1.6rem; }
.ms-opt-row { display: flex; align-items: center; gap: 0.3rem; }
.ms-opt-row .ms-grow { flex: 1; }
.ms-opt-row .ms-indent { width: 1.05rem; display: inline-block; }

/* Predicate-editor option checkboxes: one per line (the unverified +
   confirmed-eligibility labels ran together inline). */
.ms-check-row { display: block; margin-top: 0.4rem; }

/* Gate-match honesty badge (2026-07-06): the unconfirmed state reads quieter than
   the shared .badge so a disclosed unknown never shouts louder than a real signal. */
.badge-muted { background: #f0f0f0; color: #666; border-color: #ddd; }

/* Sources cards: long canonical URLs must wrap inside their container on
   mobile instead of blowing out the layout (owner, 2026-07-09). Links stay
   clickable (they are real <a target=_blank> rows). */
#sources-list .sort-card { flex-wrap: wrap; }
#sources-list .sort-card a {
    overflow-wrap: anywhere;
    word-break: break-all;
    min-width: 0;
}


/* Browse results table (2026-07-13 UX pass): dates in a scannable lane, status
   in a fixed lane, title-as-link. Collapses to stacked cards under 720px. */
.browse-table { width: 100%; font-size: 0.9rem; }
.browse-table th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: #667; }
.browse-table td { vertical-align: top; }
.browse-table .bt-title a { font-weight: 600; }
.browse-table .bt-sub { font-size: 0.8rem; color: #667; margin-top: 1px; }
.browse-table .bt-badges { margin-top: 3px; display: flex; gap: 0.3rem; flex-wrap: wrap; }
.browse-table .bt-date { font-weight: 600; white-space: nowrap; }
.bt-status { white-space: nowrap; font-size: 0.85rem; }
.st-open { color: #27ae60; }
.st-closing { color: #e67e22; }
.st-closed { color: #888; }
.st-rolling, .st-anticipated, .st-announced { color: #667; }
@media (max-width: 720px) {
  .browse-table thead { display: none; }
  .browse-table, .browse-table tbody, .browse-table tr, .browse-table td { display: block; width: 100%; }
  .browse-table tr { border-bottom: 1px solid var(--pico-muted-border-color); padding: 0.6rem 0; }
  .browse-table td { border: none; padding: 0.1rem 0; }
  .browse-table td[data-label="Status"]::before,
  .browse-table td[data-label="Deadline"]::before,
  .browse-table td[data-label="Est. internal"]::before {
    content: attr(data-label) ": "; font-size: 0.75rem; color: #667;
  }
  .browse-table td:empty { display: none; }
  .browse-table .bt-date { display: inline; white-space: normal; }
  .browse-table td[data-label="Deadline"] .bt-sub { display: inline; margin-left: 0.3rem; }
}


/* Sources table rides the browse-table language; URLs wrap inside their
   column, the action lane hugs the right. table-layout:fixed is what actually
   contains long unbroken URLs — auto layout sizes columns by intrinsic
   content width and overflow-wrap alone can't stop the stretch. */
.sources-table { table-layout: fixed; }
.sources-table th:nth-child(2), .sources-table td:nth-child(2) { width: 8.5rem; }
.sources-table th:nth-child(3), .sources-table td:nth-child(3) { width: 6.5rem; }
.sources-table .bt-title a { overflow-wrap: anywhere; word-break: break-all; font-weight: 500; }
.sources-table .bt-sub { overflow-wrap: anywhere; }
.sources-table .bt-action { text-align: right; white-space: nowrap; }
@media (max-width: 720px) {
  .sources-table td { width: auto; }
  .sources-table td.bt-action { text-align: left; }
  .sources-table td.bt-action::before { content: none; }
}
