/* Country register: finding and selecting provisions. The instrument chip strip, the table's select and
   work-type columns, the sticky selection bar and the search typeahead. Uses the --rg-* tokens. */

/* ---------- instrument chip strip (search or filter active) ---------- */
.rg-instruments-compact .rg-section-head { margin-bottom: 6px; }
.rg-inst-strip { display: flex; flex-wrap: nowrap; gap: 6px; list-style: none; margin: 0 0 4px; padding: 0 0 6px; overflow-x: auto; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.rg-inst-strip > li { flex: 0 0 auto; min-width: 0; max-width: 100%; }
.rg-inst-chip { display: inline-flex; align-items: center; gap: 8px; box-sizing: border-box; max-width: 100%; min-height: 34px; padding: 3px 6px 3px 12px; border: 1px solid var(--rg-line-strong); border-radius: 999px; background: var(--rg-surface); color: var(--rg-ink) !important; font-size: 13px; font-weight: 600; text-decoration: none !important; }
.rg-inst-chip:hover { background: var(--rg-wash); }
.rg-inst-chip:focus-visible { outline: 2px solid var(--rg-navy); outline-offset: 2px; }
.rg-inst-chip-name { min-width: 0; max-width: 40ch; white-space: normal; overflow-wrap: anywhere; }
.rg-inst-chip-count, .rg-inst-chip-x { flex: 0 0 auto; }
.rg-inst-chip-count { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; background: var(--rg-amber-bg); color: var(--rg-amber); font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
.rg-inst-chip.is-selected { background: var(--rg-amber-bg); border-color: var(--rg-gold); }
.rg-inst-chip-x { padding-right: 4px; color: var(--rg-muted); font-size: 16px; line-height: 1; }
.rg-inst-details { margin: 0 0 10px; }
.rg-inst-details > summary { display: inline-flex; align-items: center; min-height: 36px; padding: 0 4px; font-size: 13px; font-weight: 700; color: var(--ch-link, var(--rg-gold-ink)); cursor: pointer; }
.rg-inst-details[open] > summary { margin-bottom: 8px; }
.rg-inst-blurb { margin: 0 0 8px; font-size: 13px; color: var(--rg-muted); }
@media (max-width: 760px) {
  .rg-inst-chip { min-height: 44px; }
  .rg-inst-chip-name { max-width: none; }
}

/* ---------- table: select box and work type ---------- */
.rg-table .rgw-selcell { width: 36px; min-width: 36px; padding-left: 10px; padding-right: 0; }
.rgw-sel { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin: -4px 0; cursor: pointer; }
.rgw-sel input { width: 18px; height: 18px; margin: 0; accent-color: var(--rg-gold, #e8b923); cursor: pointer; }
.rgw-sel:has(input:focus-visible) { outline: 2px solid var(--rg-navy); outline-offset: 1px; border-radius: 4px; }
.rg-table .rg-row.is-picked { background: var(--rg-amber-bg); }
.rg-table td.rgw-col-work { min-width: 84px; max-width: 120px; }
.rg-chip-work { font-weight: 700; }
.rg-work-product { background: var(--rg-blue-bg); color: var(--rg-blue); }
.rg-work-process { background: var(--rg-amber-bg); color: var(--rg-amber); }
.rg-work-people { background: var(--rg-green-bg); color: var(--rg-green); }
.rgw-facet-note { margin: -2px 0 6px; font-size: 12px; line-height: 1.35; color: var(--rg-muted); }
@media (max-width: 760px) {
  .rg-table tr { position: relative; }
  .rg-table .rgw-selcell { position: absolute; top: 6px; right: 6px; width: 44px; min-width: 0; height: 44px; padding: 0; display: flex !important; align-items: center; justify-content: center; }
  thead .rgw-selcell { display: none; }
  .rg-table .rgw-sel { width: 44px; height: 44px; margin: 0; }
  .rg-table .rg-ref { padding-right: 44px; }
  .rg-table td[data-label="Work type"] { display: inline-block; width: auto; padding: 0 8px 0 0; }
  .rg-table td[data-label="Work type"] .rg-chip { margin: 0; display: inline-flex; }
}

/* ---------- selection bar ---------- */
.rgw-selbar { position: sticky; bottom: 12px; z-index: 30; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 14px 0 0; padding: 10px 14px; background: var(--rg-navy); color: #fff; border-radius: var(--rg-radius); box-shadow: 0 8px 28px rgba(1, 21, 48, .35); }
.rgw-selbar[hidden] { display: none; }
.country-handbook-page .rg-page .rgw-selbar-count { margin: 0 auto 0 0; font-size: 14px; color: #fff; }
.rgw-selbar .rg-btn { min-height: 40px; }
.rgw-selbar .rg-btn:not(.rg-btn-gold) { background: transparent; color: #fff !important; border-color: rgba(255, 255, 255, .5); }
@media (max-width: 760px) {
  .rgw-selbar { bottom: 8px; padding: 8px 10px; }
  .country-handbook-page .rg-page .rgw-selbar-count { flex: 1 1 100%; }
  .rgw-selbar .rg-btn { flex: 1 1 0; justify-content: center; }
}
/* Panel footer: compact so the added button does not push the details up. */
.rgw-foot .rg-btn { min-height: 36px; padding: 0 12px; font-size: 13px; }
.rgw-sel-toggle[aria-pressed="true"] { background: var(--rg-amber-bg); border-color: var(--rg-gold); }

/* ---------- search typeahead ---------- */
.ch-register-filters { position: relative; }
.rg-suggest { position: absolute; z-index: 50; margin: 4px 0 0; padding: 4px; list-style: none; background: var(--rg-surface); border: 1px solid var(--rg-line-strong); border-radius: var(--rg-radius); box-shadow: 0 12px 32px rgba(1, 21, 48, .22); max-height: 360px; overflow-y: auto; }
.rg-suggest[hidden] { display: none; }
.rg-suggest li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; min-height: 44px; padding: 8px 10px; border-radius: 6px; color: var(--rg-ink); font-size: 14px; cursor: pointer; }
.rg-suggest li[aria-selected="true"], .rg-suggest li:hover { background: var(--rg-amber-bg); }
.rg-suggest-ref { font-weight: 700; }
.rg-suggest-inst { font-size: 12.5px; color: var(--rg-muted); }
.rg-suggest-head { flex: 1 1 100%; font-size: 13px; color: var(--rg-muted); }

/* ---------- a search is active: keep the table on the first screen ---------- */
.rg-page[data-rg-tab="obligations"] .rg-panel-intro { margin-bottom: 4px; }
.rg-page[data-rg-tab="obligations"] .rg-panel-intro h2 { margin: 0; font-size: 18px; }
.rg-topic-answer.is-collapsible { padding: 0; }
.rg-topic-answer.is-collapsible > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; padding: 10px 14px; cursor: pointer; list-style: none; }
.rg-topic-answer.is-collapsible > summary::-webkit-details-marker { display: none; }
.rg-topic-answer.is-collapsible > summary::after { content: "Show"; margin-left: auto; font-size: 13px; font-weight: 700; color: var(--ch-link, var(--rg-gold-ink)); }
.rg-topic-answer.is-collapsible[open] > summary::after { content: "Hide"; }
.rg-topic-answer.is-collapsible > summary .rg-topic-eyebrow { margin: 0; }
.rg-topic-answer.is-collapsible > summary strong { font-size: 15px; }
.rg-topic-answer.is-collapsible > .rg-topic-body { padding: 0 14px 12px; }

/* The table gained a select column and a work-type column: tighter cell padding keeps the summary readable. */
@media (min-width: 761px) {
  .rgw-main .rg-table th, .rgw-main .rg-table td { padding-left: 8px; padding-right: 8px; }
  .rgw-main .rg-table td[data-label="Theme"], .rgw-main .rg-table td[data-label="Applies to"] { min-width: 88px; max-width: 120px; }
  .rgw-main .rg-table td.rgw-col-work { min-width: 70px; max-width: 96px; }
  .rgw-main .rg-table td.rg-sum { min-width: 170px; }
}
