.emerge-tpf-wrap {
  position: relative;
  font-size: 14px;
  line-height: 1.45;
  color: #222;
}

.emerge-tpf-wrap.is-loading {
  opacity: 0.65;
  pointer-events: none;
}

.emerge-tpf-filters {
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid #e6e6ea;
  border-radius: 10px;
  background: #fff;
}

.emerge-tpf-toolbar {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.emerge-tpf-toolbar__main,
.emerge-tpf-toolbar__side {
  min-width: 0;
}

.emerge-tpf-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.emerge-tpf-field {
  margin-bottom: 0;
}

.emerge-tpf-field label {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  color: #3a3a3a;
}

.emerge-tpf-field input[type="text"],
.emerge-tpf-field select,
.emerge-tpf-keyword-search {
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  box-sizing: border-box;
  border: 1px solid #d8d8df;
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  line-height: 1.3;
}

.emerge-tpf-keyword-panel {
  border: 1px solid #e2e2e8;
  border-radius: 10px;
  background: #fafafc;
  padding: 10px;
}

.emerge-tpf-keyword-panel__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.emerge-tpf-keyword-panel__header label {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: #3a3a3a;
}

.emerge-tpf-keyword-panel__hint {
  font-size: 11px;
  color: #777;
}

.emerge-tpf-keyword-search {
  margin-bottom: 8px;
}

.emerge-tpf-keyword-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 4px;
}

.emerge-tpf-keyword-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 4px 2px;
  font-size: 12px;
  line-height: 1.3;
  cursor: pointer;
}

.emerge-tpf-keyword-item input {
  margin: 0;
  flex: 0 0 auto;
}

.emerge-tpf-keyword-item span {
  display: block;
  min-width: 0;
  word-break: break-word;
}

.emerge-tpf-actions {
  margin-top: 10px;
}

.emerge-tpf-button {
  display: inline-block;
  background: #292899;
  color: #fff;
  text-decoration: none;
  border: none;
  padding: 7px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1.2;
}

.emerge-tpf-button--secondary {
  background: #666;
}

.emerge-tpf-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.emerge-tpf-active-chip {
  background: #eef0ff;
  color: #292899;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  line-height: 1.2;
}

.emerge-tpf-results-head {
  margin-bottom: 10px;
}

.emerge-tpf-results-count {
  font-weight: 600;
  font-size: 13px;
  color: #333;
}

.emerge-tpf-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.emerge-tpf-card {
  border: 1px solid #e4e4ea;
  border-radius: 10px;
  padding: 12px;
  background: #fff;
}

.emerge-tpf-card__title {
  margin: 0 0 6px;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 600;
}

.emerge-tpf-card__title a {
  text-decoration: none;
}

.emerge-tpf-card__meta {
  margin-bottom: 7px;
  color: #60606a;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 500;
}

.emerge-tpf-card__keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}

.emerge-tpf-badge {
  display: inline-block;
  background: #292899;
  color: #fff;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 10px;
  line-height: 1.2;
}

.emerge-tpf-badge--muted {
  background: #ececf6;
  color: #444;
}

.emerge-tpf-card__aim {
  margin-bottom: 10px;
  font-size: 12px;
  line-height: 1.4;
  color: #333;
}

.emerge-tpf-card__actions {
  margin-top: 6px;
}

.emerge-tpf-pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
}

.emerge-tpf-page-btn {
  background: #292899;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 12px;
}

.emerge-tpf-page-info {
  font-size: 12px;
  color: #555;
}

.emerge-tpf-no-results {
  padding: 14px;
  background: #fafafa;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  font-size: 13px;
}

@media (max-width: 1024px) {
  .emerge-tpf-toolbar {
    grid-template-columns: 1fr;
  }

  .emerge-tpf-filter-grid,
  .emerge-tpf-grid,
  .emerge-tpf-keyword-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .emerge-tpf-filter-grid,
  .emerge-tpf-grid,
  .emerge-tpf-keyword-list {
    grid-template-columns: 1fr;
  }
}