.searchform {
  --sdc-bg: #f3f5f7;
  --sdc-surface: #ffffff;
  --sdc-border: #dfe5ec;
  --sdc-text: #2f3a46;
  --sdc-subtle: #667585;
  --sdc-chip: #eceff3;
  --sdc-chip-active: #d8e0e8;
  --sdc-chip-active-text: #364a5d;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px;
  border: 1px solid #e2e8ef;
  border-radius: 10px;
  background: #f3f5f7;
  position: relative;
}

.searchform .search_input_wrap { position: relative; flex: 1; min-width: 240px; }
.searchform .search_control_row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.searchform .s {
  flex: 1; min-height: 42px; border: 0; border-radius: 8px;
  background: var(--sdc-surface); color: var(--sdc-text); padding: 0 12px;
}
.searchform .s:focus { outline: none; box-shadow: none; }

.searchform .search_input_with_selected {
  flex: 1;
  min-height: 42px;
  border-radius: 8px;
  background: var(--sdc-surface);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  min-width: 0;
}

.searchform .search_input_with_selected .s {
  min-height: 34px;
  height: 34px;
  padding: 0 4px;
  background: transparent;
  border-radius: 0;
}

.searchform .sdc-selected-list--input {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  min-height: 22px;
}

.searchform .sdc-selected-list--input.is-empty {
  display: none;
}

.searchform .sdc-selected-list--input .sdc-selected-chip {
  border: 1px solid #bfd0e2;
  background: #d9e6f2;
  color: #233a52;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.searchform .sdc-selected-list--input .sdc-selected-chip span {
  font-size: 12px;
}
.searchform .searchsubmit {
  min-height: 28px; min-width: 56px; border-radius: 8px; border: 0;
  background: #f6f8fa;
  color: #8a97a5; font-weight: 600; font-size: 11px;
  box-shadow: none;
  transition: none;
}
.searchform #switch_custom_search_show_btn {
  display: inline-flex; position: static; z-index: 2;
}
.searchform #switch_custom_search_show_btn .search_show_btn {
  display: inline-flex; align-items: center; border: 0; border-radius: 8px;
  padding: 7px 9px; background: #f6f8fa; color: #7f8c9a; font-size: 12px; font-weight: 600; line-height: 1;
  cursor: pointer;
}
.searchform #switch_custom_search_show_btn .search_show_btn span { padding-right: 5px; }
.searchform .searchsubmit-inline {
  position: static;
  padding: 0 8px; z-index: 2;
}

.searchform .search_control_row > .searchsubmit.searchsubmit-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  max-width: none;
  white-space: nowrap;
  margin: 5px;
  float: none;
  line-height: 1;
  background: #ffffff;
  color: #a4a4a4;
}

.searchform .search_control_row > .searchsubmit.searchsubmit-inline:hover {
  background: #f6f8fa;
  color: #8a97a5;
  box-shadow: none;
}

.searchform .search_control_row > .searchsubmit.searchsubmit-inline:focus {
  outline: none;
  border-color: #d8e2eb;
  box-shadow: none;
}

#custom_search {
  margin-top: 8px; padding: 14px; border: 1px solid var(--sdc-border); border-radius: 14px;
  background: linear-gradient(180deg,#f8fafb 0%,#f2f4f7 100%); box-shadow: 0 14px 30px rgba(35,47,62,.12);
  width: 100%; visibility: hidden; opacity: 0; pointer-events: none; position: absolute;
  left: 0; top: calc(100% + 6px); z-index: 25;
}
#custom_search::before {
  content: ""; position: absolute; top: -7px; left: 24px; width: 12px; height: 12px;
  border-left: 1px solid var(--sdc-border); border-top: 1px solid var(--sdc-border);
  background: #f8fafb; transform: rotate(45deg);
}

#custom_search .sdc-type-row { display: flex; flex-wrap: wrap; gap: 6px; }

#custom_search label { display: inline-flex; align-items: center; margin: 0; cursor: pointer; }
#custom_search label input[type="checkbox"] { display: none; }
#custom_search label input[type="checkbox"] + span {
  display: inline-block; background: var(--sdc-chip); color: #4d5b69; border: 1px solid #dce3ea;
  border-radius: 999px; padding: 6px 12px; user-select: none; font-size: 13px;
}
#custom_search label input[type="checkbox"]:checked + span {
  background: var(--sdc-chip-active); color: var(--sdc-chip-active-text); border-color: #c3cfda; font-weight: 700;
}

#custom_search .sdc-cascader-block { border: 1px solid #e2e8ef; border-radius: 10px; overflow: hidden; background: #fff; }
#custom_search .sdc-cascader-title {
  padding: 8px 10px; font-size: 13px; font-weight: 700; color: #5a6c7e; background: #f5f8fb; border-bottom: 1px solid #e6edf4;
}
#custom_search .sdc-cascader-panels { display: grid; grid-template-columns: 220px 1fr; min-height: 220px; }
#custom_search .sdc-cascader-panel { overflow: auto; }
#custom_search .sdc-cascader-left { border-right: 1px solid #e7edf3; background: #fbfcfd; }

#custom_search .sdc-cascader-node {
  width: 100%; border: 0; border-bottom: 1px solid #eef2f6; background: transparent; color: #4e5d6d;
  text-align: left; padding: 10px 12px; font-size: 13px; cursor: pointer;
}
#custom_search .sdc-cascader-node.active { background: #eef3f8; color: #32485e; font-weight: 700; }

#custom_search .sdc-cascader-options { display: none; padding: 10px; gap: 6px; align-content: flex-start; }
#custom_search .sdc-cascader-options.active { display: grid; grid-template-columns: repeat(auto-fill,minmax(160px,1fr)); }

@media (max-width: 767px) {
  .searchform { flex-wrap: wrap; padding: 8px; }
  .searchform .search_input_wrap { width: 100%; }
  .searchform .search_control_row { gap: 6px; }
  .searchform .s { min-width: 0; }
  .searchform .search_input_with_selected { min-width: 0; }
  .searchform .sdc-selected-list--input { width: 100%; }
  .searchform .search_control_row > .searchsubmit.searchsubmit-inline { width: auto; }

  #custom_search { position: static; margin-top: 8px; box-shadow: none; }
  #custom_search::before { display: none; }
  #custom_search .sdc-cascader-panels { grid-template-columns: 1fr; }
  #custom_search .sdc-cascader-left { border-right: 0; border-bottom: 1px solid #e7edf3; }
}

/* Cascader 3-level */
#custom_search .sdc-cascader3 {
  display: grid;
  grid-template-columns: 120px 230px 1fr;
  grid-template-rows: minmax(260px, auto) auto;
  min-height: 260px;
  border: 1px solid #e2e8ef;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

#custom_search .sdc-cascader3.ai-mode {
  grid-template-columns: 120px 1fr;
}

#custom_search .sdc-col {
  overflow: auto;
  min-height: 260px;
}

#custom_search .sdc-col-1,
#custom_search .sdc-col-2 {
  border-right: 1px solid #e8edf3;
  background: #fafbfd;
}

#custom_search .sdc-cascader3.ai-mode .sdc-col-2 {
  display: none;
}

#custom_search .sdc-node {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #edf2f7;
  padding: 10px 12px;
  color: #4f5f6f;
  font-size: 13px;
  cursor: pointer;
}

#custom_search .sdc-node.active {
  background: #e7f1e9;
  color: #2f5e49;
  font-weight: 800;
  box-shadow: inset 3px 0 0 #84bd90;
}

#custom_search .sdc-options {
  display: none;
  grid-template-columns: repeat(auto-fill,minmax(150px,1fr));
  gap: 6px;
  padding: 10px;
}

#custom_search .sdc-options.active {
  display: grid;
}

#custom_search .sdc-cascader-logic-hint {
  grid-column: 1 / -1;
  padding: 9px 12px;
  border-top: 1px solid #e6ebf1;
  background: #f7f9fb;
  color: #5c6f83;
  font-size: 12px;
  line-height: 1.5;
}

#custom_search .sdc-cascader-footer {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-top: 1px solid #e6ebf1;
  background: #f7f9fb;
}

#custom_search .sdc-selected-list {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 32px;
  align-items: center;
}

#custom_search .sdc-selected-empty {
  font-size: 12px;
  color: #6f7f8f;
}

#custom_search .sdc-selected-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #bfd0e2;
  background: #d9e6f2;
  color: #233a52;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

#custom_search .sdc-selected-chip span {
  font-size: 13px;
  line-height: 1;
}

#custom_search .sdc-clear-btn {
  border: 1px solid #cfd9e3;
  background: #edf2f6;
  color: #3d5164;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

#custom_search .sdc-clear-btn:hover {
  background: #e3eaf1;
}

#custom_search .sdc-options label input[type="checkbox"] + span {
  border-width: 1px;
}

#custom_search .sdc-options label input[type="checkbox"]:checked + span {
  background: #cfddeb;
  border-color: #7f9ab6;
  color: #223a52;
  font-weight: 800;
  box-shadow: 0 0 0 2px rgba(127, 154, 182, 0.22);
}

#custom_search .sdc-options label.sdc-kind-lv input[type="checkbox"] + span {
  background: #eef4fb;
  border-color: #d4e1f1;
  color: #355574;
}

#custom_search .sdc-options label.sdc-kind-lv input[type="checkbox"]:checked + span {
  background: #cfe0f3;
  border-color: #7c9cbe;
  color: #1f3f60;
  box-shadow: 0 0 0 2px rgba(124, 156, 190, 0.24);
}

#custom_search .sdc-options label.sdc-kind-class input[type="checkbox"] + span {
  background: #f3effc;
  border-color: #ddd2f3;
  color: #56427c;
}

#custom_search .sdc-options label.sdc-kind-class input[type="checkbox"]:checked + span {
  background: #ded1f8;
  border-color: #9a84cc;
  color: #45306f;
  box-shadow: 0 0 0 2px rgba(154, 132, 204, 0.24);
}

#custom_search .sdc-options label.sdc-kind-ai input[type="checkbox"] + span {
  background: #fff3dc;
  border-color: #f1cf8a;
  color: #6b4200;
}

#custom_search .sdc-options label.sdc-kind-ai input[type="checkbox"]:checked + span {
  background: #ffe0ab;
  border-color: #d9a044;
  color: #4a2b00;
  box-shadow: 0 0 0 2px rgba(217, 160, 68, 0.24);
}

.searchform .sdc-selected-list--input .sdc-selected-chip.sdc-selected-chip--lv {
  border-color: #abc3dd;
  background: #d7e6f6;
  color: #274867;
}

.searchform .sdc-selected-list--input .sdc-selected-chip.sdc-selected-chip--class {
  border-color: #c8b7e7;
  background: #e4daf7;
  color: #4d3779;
}

.searchform .sdc-selected-list--input .sdc-selected-chip.sdc-selected-chip--ai {
  border-color: #e2b96f;
  background: #ffe6bd;
  color: #5a3500;
}

@media (max-width: 767px) {
  #custom_search .sdc-cascader3 {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    min-height: 0;
  }

  #custom_search .sdc-col-1,
  #custom_search .sdc-col-2 {
    border-right: 0;
    border-bottom: 1px solid #e8edf3;
  }

  #custom_search .sdc-col {
    min-height: 0;
    max-height: 220px;
  }

  #custom_search .sdc-cascader-footer {
    flex-direction: column;
    align-items: stretch;
  }

  #custom_search .sdc-clear-btn {
    width: 100%;
  }
}

.page-title .entry-header .sdc-search-filter-note {
  margin: 14px auto 0;
  padding: 10px 12px 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  max-width: 860px;
  text-align: left;
}

.page-title .entry-header .sdc-search-filter-title {
  display: none;
}

.page-title .entry-header .sdc-search-filter-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.page-title .entry-header .sdc-search-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border: 1px solid #d3dde7;
  border-radius: 999px;
  background: #eef3f8;
  color: #42586e;
  font-size: 12px;
  line-height: 1.2;
}

.page-title .entry-header .sdc-search-filter-chip strong {
  font-weight: 700;
  color: #2f4860;
}

@media (max-width: 767px) {
  .page-title .entry-header .sdc-search-filter-note {
    margin-top: 10px;
    padding: 9px 10px 10px;
    border-radius: 10px;
  }

  .page-title .entry-header .sdc-search-filter-list {
    gap: 6px;
  }

  .page-title .entry-header .sdc-search-filter-chip {
    font-size: 11px;
    padding: 4px 9px;
  }
}
