.advanced-settings { border-bottom: 1px solid #2b2b2b; }
.advanced-body { padding-bottom: 12px; }
.advanced-toolbar { display: flex; align-items: center; justify-content: center; margin: 0 0 10px; font-size: 14.4px; color: #777; }
.advanced-toolbar button { border: 0; background: none; color: #bbb; padding: 12px 18px; font: inherit; cursor: pointer; }
.filter-section { border-top: 1px solid #282828; }
.filter-section-body { display: grid; gap: 23px; padding: 0 0 25px; }
.compact-chips { gap: 8px; }
.compact-chips .work-format { padding: 10px 12px; min-height: 40px; font-size: 13px; border-radius: 13px; }
.compact-chips .work-format input { width: 15px; height: 15px; }
.filter-check { display: grid; grid-template-columns: 18px 1fr; align-items: center; gap: 8px 10px; font-size: 14px; color: #ddd; cursor: pointer; }
.filter-check input { width: 18px; height: 18px; margin: 0; accent-color: #ffd166; }
.filter-check small { grid-column: 2; color: #777; font-size: 12px; }
.filter-hint, .filter-demo, .reference-empty { color: #888; font-size: 12px; line-height: 1.5; margin: 10px 0 0; }
.filter-demo { padding: 14px 0 4px; color: #737373; }
.reference-list { display: grid; max-height: 230px; overflow-y: auto; margin-top: 8px; gap: 4px; }
.reference-row { width: 100%; border: 0; background: transparent; text-align: left; display: flex; align-items: center; gap: 12px; padding: 10px 12px; min-height: 44px; border-radius: 14px; cursor: pointer; color: #aaa; font-size: 14px; }
.reference-row:hover { background: #202020; }
.reference-row[hidden], .reference-empty[hidden], .employer-logo img[hidden] { display: none; }
.reference-copy { min-width: 0; overflow-wrap: anywhere; }
.reference-copy small { display: block; margin-top: 4px; font-size: 12px; color: #888; }
.employer-logo { position: relative; display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 11px; background: #383838; color: #fff; overflow: hidden; }
.employer-logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
#search-dialog .form > .modal-actions { position: sticky; bottom: -32px; z-index: 2; margin-top: 0; padding: 20px 0 16px; background: #111; box-shadow: 0 -12px 18px #111; animation: none; }
#search-dialog { scrollbar-width: thin; scrollbar-color: #444 #111; }
#search-dialog .field :is(input, select) { border: 0; background-color: #202020; padding: 0 18px; color: #fff; font-family: inherit; font-size: 16px; line-height: 1.25; }
#search-dialog .field select { padding-right: 48px; }
@media (max-width: 600px) {
  #search-dialog .form > .modal-actions { bottom: -22px; padding-bottom: 8px; }
  .compact-chips .work-format { font-size: 12px; }
}

.reference-list[hidden] { display: none; }
.reference-list { padding: 6px; border: 1px solid #333; border-radius: 16px; background: #191919; }
.reference-row[aria-selected="true"] { background: #303030; color: #fff; }
.reference-selected { display: flex; flex-wrap: wrap; gap: 8px; }
.reference-selected:not(:empty) { margin-bottom: 10px; }
.reference-tag { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 7px 10px 7px 13px; border: 1px solid #454545; border-radius: 12px; background: #292929; font-size: 13px; color: #eee; }
.reference-tag > span { min-width: 0; overflow-wrap: anywhere; }
.reference-tag button { flex: none; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: #aaa; font-size: 21px; }
.reference-tag button:hover { background: #404040; color: #fff; }
.reference-status { color: #999; font-size: 12px; line-height: 1.5; }
.reference-status:not(:empty) { margin-top: 10px; }
.reference-picker input:disabled { opacity: .45; cursor: not-allowed; }

#search-dialog :is(input, select, button):focus-visible { outline: 2px solid #ffd166; outline-offset: 3px; }

/* Compact fields in the existing Spok palette and form geometry. */
.advanced-body > .search-fieldset { margin-bottom: 26px; }
#resume-picker { padding-bottom: 22px; border-bottom: 1px solid #282828; }
#resume-picker .resume-refresh { margin-top: 16px; }
#resume-picker .resume-refresh-button { width: 100%; min-height: 52px; padding: 14px 20px; border: 0; border-radius: 999px; background: #353535; color: #e4e4e4; font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; transition: background .18s, color .18s; }
#resume-picker .resume-refresh-button:hover { background: #414141; color: #fff; }
#resume-picker .resume-refresh-button:active { background: #484848; }
#resume-picker select:disabled { opacity: .7; cursor: not-allowed; }
.choice-picker { border-radius: 18px; background: #202020; min-width: 0; }
.choice-picker summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 56px; padding: 16px 18px; color: #ddd; font-size: 14px; cursor: pointer; list-style: none; }
.choice-picker summary::-webkit-details-marker { display: none; }
.choice-picker summary::after { content: ""; flex: 0 0 24px; width: 24px; height: 24px; margin-left: auto; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / 24px no-repeat; transition: transform .18s; }
.choice-picker[data-choice-picker] summary::after { margin-left: 0; }
.choice-picker[data-choice-picker] summary > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.choice-picker[open] > summary::after { transform: rotate(180deg); }
.choice-picker [data-choice-summary] { min-width: 0; margin-left: auto; max-width: 48%; text-align: right; color: #999; overflow-wrap: anywhere; }
.choice-picker-body { display: grid; gap: 22px; padding: 4px 16px 20px; }
.choice-picker-body .work-format { background: #292929; }
.choice-picker-body .work-format:has(input:checked) { background: #383838; }
.choice-picker summary:focus-visible { outline: 2px solid #ffd166; outline-offset: 3px; border-radius: 18px; }
.income-fields { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 12px; }
.filter-toggle { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 68px; padding: 16px 18px; border-radius: 18px; background: #202020; font-size: 14px; line-height: 1.5; color: #ddd; cursor: pointer; }
.filter-toggle input { position: absolute; right: 18px; width: 44px; height: 26px; margin: 0; opacity: 0; }
.filter-toggle-track { position: relative; flex: 0 0 44px; height: 26px; border-radius: 99px; background: #444; transition: background .18s; }
.filter-toggle-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #ddd; transition: transform .18s; }
.filter-toggle input:checked + .filter-toggle-track { background: #ffd166; }
.filter-toggle input:checked + .filter-toggle-track::after { transform: translateX(18px); background: #171717; }
.filter-toggle:has(input:focus-visible) { outline: 2px solid #ffd166; outline-offset: 3px; }
@media (max-width: 420px) {
  .income-fields { grid-template-columns: minmax(0, 1fr) 120px; gap: 8px; }
  #search-dialog .income-fields .field select { padding-left: 12px; padding-right: 30px; background-position: right 8px center; font-size: 14px; }
  .choice-picker summary { gap: 10px; }
  .choice-picker [data-choice-summary] { max-width: 55%; }
}

/* One focus treatment per chip, only when navigating with the keyboard. */
#search-dialog .work-format:focus-within { outline: none; }
#search-dialog .work-format:has(input:focus-visible) { border-color: #ffd166; }
#search-dialog .work-format input:focus-visible { outline: none; }
#search-dialog .field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-size: 24px; background-repeat: no-repeat; background-position: right 18px center; }

.filter-section h3 { margin: 0; padding: 22px 0 18px; color: #eee; font-size: 16px; font-weight: 500; }
#search-dialog .visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
