/* Search + filters for the game/study directories; pairs with directory.js.
   Uses --blue, --ink, --muted, --soft from site.css. */
.filters { position: relative; margin: 0 0 24px; }
.filters #q { width: 100%; padding: 13px 16px; border: 1px solid #cfd6e4; border-radius: 4px; font-size: 1rem; font-family: inherit; }
.filters #q:focus { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }
.facet-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; }
.facet-btn { display: inline-flex; align-items: center; gap: 6px; background: #fff; color: var(--ink); border: 1px solid #cfd6e4; border-radius: 4px; padding: 7px 14px; font: inherit; font-size: .9rem; font-weight: 700; cursor: pointer; }
.facet-btn:hover, .facet-btn.open { border-color: var(--blue); }
.facet-btn.on { border-color: var(--blue); color: var(--blue); }
.facet-n { background: var(--blue); color: #fff; border-radius: 999px; font-size: .75rem; min-width: 1.4em; padding: 0 5px; text-align: center; line-height: 1.4; }
.caret { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor; opacity: .6; }
.facet-btn.open .caret { transform: rotate(180deg); }
.count { margin: 0 0 0 auto; color: var(--muted); font-size: .9rem; }
.panel { position: absolute; left: 0; right: 0; z-index: 10; margin-top: 6px; background: #fff; border: 1px solid #cfd6e4; border-radius: 10px; box-shadow: 0 8px 24px rgba(20, 30, 60, .12); padding: 12px; max-height: min(360px, 60vh); overflow-y: auto; }
.panel-q { width: 100%; padding: 7px 10px; border: 1px solid #e3e7ef; border-radius: 6px; font: inherit; font-size: .9rem; margin: 0 0 8px; }
.panel-none { color: var(--muted); font-size: .9rem; margin: 4px 2px; }
.opts { columns: 3 190px; column-gap: 16px; }
.jel-opts { columns: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); column-gap: 16px; }
.opt { display: flex; align-items: baseline; gap: 7px; padding: 3px 4px; border-radius: 5px; font-size: .9rem; cursor: pointer; break-inside: avoid; }
.opt:hover { background: var(--soft); }
.opt[hidden] { display: none; }
.opt input { margin: 0; accent-color: var(--blue); flex: none; position: relative; top: 1px; }
.opt-l { flex: 1; }
.opt-n { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.jel-opts .opt-l { font-family: ui-monospace, Menlo, Consolas, monospace; }
.grp + .grp { margin-top: 10px; padding-top: 10px; border-top: 1px solid #eef1f6; }
.grp-h { font-size: .8rem; color: var(--muted); margin: 0 0 4px 4px; }
.grp-k { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700; color: var(--blue); margin-right: 6px; }
.active { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0 0; }
.active[hidden] { display: none; }
.pill { display: inline-flex; align-items: center; gap: 5px; background: var(--blue); color: #fff; border: 0; border-radius: 999px; padding: 3px 10px 3px 8px; font: inherit; font-size: .85rem; cursor: pointer; }
.pill.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
.pill .x { opacity: .8; font-size: 1rem; line-height: 1; }
.pill:hover .x { opacity: 1; }
.clear { background: none; border: 0; color: var(--blue); font: inherit; font-size: .85rem; cursor: pointer; text-decoration: underline; padding: 3px 4px; }
/* Tags on each card: keywords as pills, then one quiet line of JEL codes. */
.card .tags { margin: -4px 0 16px; font-size: .8rem; color: var(--muted); line-height: 1.7; }
.tags .kw, .tags .jel { display: flex; flex-wrap: wrap; align-items: center; }
.tags .kw { gap: 6px; margin-bottom: 8px; }
.tags .jel::before { content: "JEL"; font-size: .68rem; font-weight: 800; letter-spacing: .14em; margin-right: 8px; color: var(--ink); }
.tags button { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.tags .kw button { background: var(--soft); border: 1px solid transparent; border-radius: 999px; padding: 1px 10px; }
.tags .kw button:hover { border-color: var(--blue); color: var(--blue); }
.tags .kw button.on { background: var(--blue); color: #fff; font-weight: 700; }
.tags .jel button:hover, .tags .jel button.on { color: var(--blue); text-decoration: underline; }
.tags .jel button.on { font-weight: 700; }
.tags .jel button { font-family: ui-monospace, Menlo, Consolas, monospace; }
.tags .jel button + button::before { content: "·"; color: #b7bfcd; margin: 0 6px; display: inline-block; text-decoration: none; }
@media (max-width: 520px) {
  .count { flex-basis: 100%; margin: 2px 0 0; }
  .opts { columns: 1; }
  .jel-opts { grid-template-columns: repeat(3, 1fr); }
}
