/* ============================================================
   Forkast — Shared Filter button + panel
   The toggle now sits on its own row right below .page-header
   (the same vertical slot Market Overview used for the Family
   selector). All four groups inside the panel are multi-select.
   ============================================================ */

:root {
  --fk-brand:        #0fb857;
  --fk-brand-light:  #f0fdf4;
  --fk-brand-border: #bbf7d0;
  --fk-text:         #111827;
  --fk-secondary:    #6b7280;
  --fk-muted:        #9ca3af;
  --fk-border:       #e5e7eb;
  --fk-border-soft:  #f3f4f6;
  --fk-surface:      #ffffff;
  --fk-surface-2:    #f9fafb;
}

/* Standalone row that holds the toggle + collapsible panel. ----- */
.fk-filter-row {
  margin: 0 0 14px;
}

/* Toggle button --------------------------------------------------- */
.fk-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--fk-brand);
  background: var(--fk-surface);
  border: 1px solid var(--fk-brand);
  padding: 8px 14px;
  border-radius: 9999px;
  cursor: pointer;
  font-family: inherit;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.fk-filter-toggle:hover { background: var(--fk-brand-light); }
.fk-filter-toggle[aria-expanded="true"] { background: var(--fk-brand-light); }
.fk-filter-toggle svg { width: 14px; height: 14px; stroke-width: 2.2; }
.fk-filter-count { font-weight: 700; }
.fk-filter-count:empty { display: none; }

/* Collapsible panel ---------------------------------------------- */
.fk-filters-panel {
  background: var(--fk-surface);
  border: 1px solid var(--fk-border);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  overflow: hidden;
  max-height: 0;
  margin-top: 0;
  transition: max-height 0.25s ease, margin-top 0.25s ease;
}
.fk-filters-panel[data-open="true"] {
  max-height: 900px;
  margin-top: 12px;
}
.fk-filters-inner { padding: 20px 24px; }

.fk-filters-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.8fr) minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 24px;
}
@media (max-width: 1100px) {
  .fk-filters-grid { grid-template-columns: 1fr 1fr; gap: 20px; }
}
@media (max-width: 700px) {
  .fk-filters-grid { grid-template-columns: 1fr; gap: 18px; }
}

.fk-fg-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.fk-fg-head h4 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fk-muted);
  margin: 0;
}
.fk-loc-count {
  font-size: 11px;
  color: var(--fk-muted);
}

.fk-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fk-chip {
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 9999px;
  border: 1px solid var(--fk-border);
  background: var(--fk-surface);
  color: var(--fk-secondary);
  cursor: pointer;
  font-family: inherit;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.fk-chip:hover { border-color: var(--fk-brand); color: var(--fk-brand); }
.fk-chip[data-active="green"] {
  background: var(--fk-brand);
  color: #ffffff;
  border-color: var(--fk-brand);
}
.fk-chip[data-active="dark"] {
  background: var(--fk-text);
  color: #ffffff;
  border-color: var(--fk-text);
}
.fk-chip[data-active="green"]:hover,
.fk-chip[data-active="dark"]:hover { opacity: 0.92; }

.fk-cap-note {
  font-size: 11.5px;
  color: var(--fk-muted);
  margin-top: 10px;
  line-height: 1.5;
}

/* Active chip strip ---------------------------------------------- */
.fk-active-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--fk-border);
}
.fk-rmchip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 10px 5px 12px;
  border-radius: 9999px;
  background: var(--fk-surface-2);
  border: 1px solid var(--fk-border);
  color: var(--fk-text);
}
.fk-rmchip button {
  background: none;
  border: 0;
  color: var(--fk-muted);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  padding: 2px;
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
}
.fk-rmchip button:hover { color: #dc2626; background: #fef2f2; }
.fk-empty-chips { font-size: 12px; color: var(--fk-muted); }
