:root {
  --smart-orange: #f15a24;
  --smart-ink: #171717;
  --smart-paper: #fffaf4;
  --smart-line: rgba(23, 23, 23, 0.18);
  --smart-muted: #65615d;
}

.sr-only {
  border: 0 !important;
  clip: rect(0 0 0 0) !important;
  height: 1px !important;
  margin: -1px !important;
  overflow: hidden !important;
  padding: 0 !important;
  position: absolute !important;
  white-space: nowrap !important;
  width: 1px !important;
}

.smart-search-ready .hero .search-panel,
.smart-search-legacy-hidden {
  display: none !important;
}

.smart-search-ready .hero {
  overflow: visible;
}

.smart-home-search {
  margin-top: 34px;
  max-width: 1000px;
  position: relative;
  z-index: 8;
}

.smart-home-form {
  align-items: stretch;
  background: #fff;
  border: 2px solid var(--smart-ink);
  box-shadow: 8px 8px 0 rgba(23, 23, 23, 0.12);
  display: grid;
  grid-template-columns: minmax(300px, 1.6fr) minmax(210px, 0.75fr) auto;
}

.smart-query-wrap,
.smart-area-wrap {
  border-right: 1px solid var(--smart-line);
  display: block;
  min-width: 0;
  padding: 13px 18px 12px;
  position: relative;
}

.smart-query-wrap > label,
.smart-area-wrap > span,
.smart-filter-bar label:not(.smart-check) {
  color: var(--smart-muted);
  display: block;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.11em;
  margin-bottom: 5px;
  text-transform: uppercase;
}

.smart-input-row {
  align-items: center;
  display: flex;
  gap: 10px;
}

.smart-input-row > span {
  color: var(--smart-orange);
  font-size: 1.45rem;
  font-weight: 900;
}

.smart-input-row input,
.smart-area-wrap select,
.smart-filter-bar select,
.smart-directory-dock input,
.smart-directory-dock select {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--smart-ink);
  font: inherit;
  font-size: 0.98rem;
  font-weight: 750;
  min-width: 0;
  outline: 0;
  width: 100%;
}

.smart-input-row input::placeholder,
.smart-directory-dock input::placeholder {
  color: #8b8681;
  font-weight: 600;
}

.smart-area-wrap select,
.smart-filter-bar select,
.smart-directory-dock select {
  background-image: linear-gradient(45deg, transparent 50%, var(--smart-ink) 50%), linear-gradient(135deg, var(--smart-ink) 50%, transparent 50%);
  background-position: calc(100% - 12px) 52%, calc(100% - 7px) 52%;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
  padding-right: 24px;
}

.smart-clear-query {
  align-items: center;
  background: #eee8e1;
  border: 0;
  border-radius: 50%;
  color: var(--smart-ink);
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 28px;
  font-size: 1.15rem;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.smart-submit,
.smart-directory-dock form > button {
  align-items: center;
  background: var(--smart-ink);
  border: 0;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 900;
  gap: 18px;
  justify-content: center;
  letter-spacing: 0.08em;
  min-height: 74px;
  padding: 0 27px;
  text-transform: uppercase;
}

.smart-submit:hover,
.smart-submit:focus-visible,
.smart-directory-dock form > button:hover,
.smart-directory-dock form > button:focus-visible {
  background: var(--smart-orange);
}

.smart-popular {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.smart-popular > span {
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.11em;
  margin-right: 3px;
  text-transform: uppercase;
}

.smart-popular button,
.smart-zero-state [data-alternative],
.smart-dock-alternatives button {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(23, 23, 23, 0.3);
  border-radius: 999px;
  color: var(--smart-ink);
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 750;
  padding: 8px 13px;
}

.smart-popular button:hover,
.smart-popular button:focus-visible,
.smart-zero-state [data-alternative]:hover,
.smart-dock-alternatives button:hover {
  background: var(--smart-ink);
  color: #fff;
}

.smart-search-help {
  color: rgba(23, 23, 23, 0.68);
  font-size: 0.78rem;
  margin: 10px 0 0;
}

.smart-suggestions {
  background: #fff;
  border: 2px solid var(--smart-ink);
  box-shadow: 8px 8px 0 rgba(23, 23, 23, 0.13);
  left: -2px;
  max-height: min(430px, 60vh);
  overflow: auto;
  position: absolute;
  right: -2px;
  top: calc(100% + 7px);
  z-index: 50;
}

.smart-suggestions button {
  align-items: center;
  background: #fff;
  border: 0;
  border-bottom: 1px solid #eee7df;
  color: var(--smart-ink);
  cursor: pointer;
  display: grid;
  font: inherit;
  gap: 12px;
  grid-template-columns: 28px 1fr auto;
  padding: 12px 14px;
  text-align: left;
  width: 100%;
}

.smart-suggestions button:last-child { border-bottom: 0; }
.smart-suggestions button:hover,
.smart-suggestions button[aria-selected="true"] { background: #fff2e8; }
.smart-suggestions button > span:nth-child(2) { display: grid; gap: 2px; min-width: 0; }
.smart-suggestions small { color: var(--smart-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.smart-suggestion-icon { color: var(--smart-orange); font-weight: 950; text-align: center; }
mark { background: #ffe0c7; color: inherit; padding: 0 0.06em; }

.smart-filter-bar {
  align-items: end;
  background: #fff;
  border: 1px solid var(--smart-line);
  color: var(--smart-ink);
  display: grid;
  gap: 12px;
  grid-template-columns: 1.2fr 1fr 0.75fr auto auto;
  margin: 20px 0 0;
  padding: 14px;
}

.smart-filter-bar label:not(.smart-check) {
  background: var(--smart-paper);
  border: 1px solid #e4ddd4;
  margin: 0;
  padding: 10px 12px;
}

.smart-filter-bar label:not(.smart-check) select { margin-top: 4px; }
.smart-check { align-items: center; cursor: pointer; display: flex; font-size: 0.82rem; font-weight: 800; gap: 8px; min-height: 48px; }
.smart-check input { accent-color: var(--smart-orange); height: 18px; width: 18px; }
#smart-clear-filters { background: transparent; border: 0; color: var(--smart-ink); cursor: pointer; font: inherit; font-size: 0.78rem; font-weight: 900; min-height: 48px; text-decoration: underline; }

.smart-search-active #listings .listing-layout,
.smart-search-active #listings > .shell > .empty-state {
  display: none !important;
}

.smart-search-results { margin-top: 24px; }
.smart-results-header { align-items: end; border-bottom: 2px solid var(--smart-ink); display: flex; gap: 24px; justify-content: space-between; margin-bottom: 22px; padding-bottom: 14px; }
.smart-results-header h2 { font-size: clamp(1.8rem, 4vw, 3.6rem); margin: 3px 0 0; }
.smart-results-header > p { color: var(--smart-muted); font-weight: 700; margin: 0 0 5px; max-width: 45%; text-align: right; }
.smart-broadened { background: #fff0e5; border-left: 4px solid var(--smart-orange); margin: -8px 0 20px; padding: 12px 14px; }
.smart-rating-note { background: #fff8e8; border-left: 4px solid #d8a63d; color: #59420d; font-size: 0.82rem; font-weight: 700; margin: -8px 0 20px; padding: 12px 14px; }
.smart-result-grid { display: grid; gap: 18px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.smart-result-card { background: #fff; border: 1px solid #d9d2ca; border-radius: 14px; color: inherit; cursor: pointer; display: flex; flex-direction: column; height: 100%; min-height: 292px; min-width: 0; overflow: hidden; padding: 20px; text-decoration: none; touch-action: manipulation; transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease; width: 100%; }
.smart-result-card:hover,
.smart-result-card:focus-visible,
.smart-result-card:focus-within { background: #fffaf5; border-color: var(--smart-orange); box-shadow: 0 0 0 3px rgba(241, 90, 36, 0.2), 0 10px 26px rgba(23, 23, 23, 0.1); outline: none; }
.smart-result-head { align-items: flex-start; display: grid; gap: 12px; grid-template-columns: 46px minmax(0, 1fr) auto; }
.smart-result-icon { align-items: center; background: #fff0e5; border: 1px solid #ffd2b5; border-radius: 12px; color: var(--smart-orange); display: flex; font-size: 1.05rem; font-weight: 950; height: 46px; justify-content: center; width: 46px; }
.smart-result-identity { min-width: 0; }
.smart-result-card h3 { color: var(--smart-ink); font-size: 1.18rem; font-weight: 950; letter-spacing: -0.025em; line-height: 1.14; margin: 0 0 6px; overflow-wrap: anywhere; }
.smart-result-meta { color: var(--smart-muted); font-size: 0.73rem !important; font-weight: 750; line-height: 1.35 !important; margin: 0 !important; }
.smart-verified-mark { align-items: center; background: #eaf8ef; border: 1px solid #8bc9a2; border-radius: 999px; color: #116b36; display: inline-flex; font-size: 0.74rem; font-weight: 950; height: 26px; justify-content: center; width: 26px; }
.smart-result-rating-row { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 12px 58px; }
.smart-rating { align-items: center; background: #fff3d9; border: 2px solid #d99916; border-radius: 999px; box-shadow: 0 3px 0 rgba(110, 74, 0, 0.12); color: #5f3f00; display: inline-flex; font-size: 0.82rem; font-weight: 950; gap: 4px; letter-spacing: 0.005em; padding: 6px 10px; white-space: nowrap; }
.smart-rating > b { color: #d98200; font-size: 1rem; font-weight: 950; line-height: 1; }
.smart-rating small { font-size: 0.72rem; font-weight: 900; }
.smart-rating.is-unrated { background: transparent; border-color: #d7cfc6; border-width: 1px; box-shadow: none; color: #6f665d; font-size: 0.72rem; font-weight: 800; padding: 5px 8px; }
.smart-rating.is-unrated > b { font-size: inherit; }
.smart-status { border: 0; border-radius: 0; font-size: 0.64rem; font-weight: 800; letter-spacing: 0; padding: 0; text-transform: none; white-space: nowrap; }
.smart-status.is-verified { color: #15713b; }
.smart-status.is-checking { color: #765b18; }
.smart-result-card p { color: var(--smart-muted); font-size: 0.84rem; line-height: 1.48; }
.smart-result-snippet { display: -webkit-box; margin: 0 0 15px; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.smart-result-footer { align-items: center; border-top: 1px solid #eee8e1; display: flex; gap: 12px; justify-content: space-between; margin-top: auto; padding-top: 13px; }
.smart-result-footer strong { align-items: center; color: var(--smart-orange); display: inline-flex; font-size: 0.78rem; gap: 5px; white-space: nowrap; }
.smart-match-reason { color: var(--smart-muted); font-size: 0.67rem; line-height: 1.3; }
.smart-result-card mark { background: transparent; box-shadow: inset 0 -0.28em #ffd9be; padding: 0; }
.smart-load-more { background: var(--smart-ink); border: 0; color: #fff; cursor: pointer; display: flex; font: inherit; font-weight: 900; justify-content: space-between; margin-top: 20px; padding: 16px 20px; width: 100%; }
.smart-load-more:hover { background: var(--smart-orange); }
.smart-zero-state { background: #fff; border: 2px solid var(--smart-ink); color: var(--smart-ink); padding: clamp(28px, 6vw, 70px); text-align: center; }
.smart-zero-state > span { color: var(--smart-orange); font-size: 3rem; }
.smart-zero-state h2 { font-size: clamp(2rem, 5vw, 4rem); margin: 8px 0 12px; }
.smart-zero-state p { margin: 0 auto 20px; max-width: 620px; }
.smart-zero-state > div { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 20px; }

.smart-directory-dock {
  background: #fffaf4;
  border-bottom: 1px solid #d8d0c7;
  position: relative;
  z-index: 25;
}
.smart-directory-dock > .shell { position: relative; }
.smart-directory-dock form { align-items: stretch; display: grid; gap: 0; grid-template-columns: minmax(230px, 1.45fr) minmax(150px, 0.62fr) minmax(145px, 0.58fr) minmax(128px, 0.48fr) auto; padding: 10px 0; }
.smart-dock-query { align-items: center; background: #fff; border: 1px solid #d7cfc6; display: flex; gap: 9px; min-width: 0; padding: 0 13px; position: relative; }
.smart-dock-query > span { color: var(--smart-orange); font-size: 1.2rem; font-weight: 900; }
.smart-directory-dock select { background-color: #fff; border: 1px solid #d7cfc6; border-left: 0; padding: 0 30px 0 12px; }
.smart-directory-dock form > button { min-height: 50px; padding: 0 20px; }
.smart-directory-dock .smart-suggestions { left: -1px; right: -1px; top: calc(100% + 6px); }
.smart-dock-results { background: #fff; border: 2px solid var(--smart-ink); box-shadow: 8px 8px 0 rgba(23, 23, 23, 0.12); left: 20px; max-height: min(580px, 70vh); overflow: auto; position: absolute; right: 20px; top: calc(100% - 2px); z-index: 80; }
.smart-dock-results > header { align-items: center; background: var(--smart-ink); color: #fff; display: flex; justify-content: space-between; padding: 12px 15px; }
.smart-dock-results > header button { background: transparent; border: 0; color: #fff; cursor: pointer; font-size: 1.4rem; }
.smart-dock-results > div:not(.smart-dock-alternatives) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.smart-dock-results > div > a { align-items: center; border-bottom: 1px solid #e8e2da; color: inherit; display: flex; gap: 14px; justify-content: space-between; min-width: 0; padding: 13px 15px; text-decoration: none; }
.smart-dock-results > div > a:nth-child(odd) { border-right: 1px solid #e8e2da; }
.smart-dock-results > div > a:hover { background: #fff2e8; }
.smart-dock-results a > span:first-child { display: grid; gap: 3px; min-width: 0; }
.smart-dock-results a strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.smart-dock-results a small { color: var(--smart-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.smart-dock-meta { align-items: flex-end; display: flex; flex-direction: column; flex: 0 0 auto; gap: 5px; }
.smart-dock-meta .smart-rating { font-size: 0.64rem; padding: 3px 6px; }
.smart-view-all { background: #fffaf4; color: var(--smart-ink); display: block; font-weight: 900; padding: 14px 15px; text-align: center; }
.smart-dock-results > p { padding: 16px; }
.smart-dock-alternatives { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 16px; }

.smart-home-search :focus-visible,
.smart-filter-bar :focus-visible,
.smart-directory-dock :focus-visible {
  outline: 3px solid #1469aa;
  outline-offset: 2px;
}

@media (max-width: 980px) {
  .smart-home-form { grid-template-columns: minmax(0, 1fr) minmax(190px, 0.65fr); }
  .smart-submit { grid-column: 1 / -1; min-height: 54px; }
  .smart-area-wrap { border-right: 0; }
  .smart-filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .smart-check, #smart-clear-filters { justify-content: center; }
  .smart-result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .smart-directory-dock form { grid-template-columns: minmax(0, 1fr) minmax(120px, 0.38fr) auto; }
  #smart-dock-category, #smart-dock-area { display: none; }
}

@media (max-width: 680px) {
  .smart-home-search { margin-top: 24px; }
  .smart-home-form { box-shadow: 5px 5px 0 rgba(23, 23, 23, 0.12); display: block; }
  .smart-query-wrap, .smart-area-wrap { border-bottom: 1px solid var(--smart-line); border-right: 0; padding: 12px 13px; }
  .smart-submit { min-height: 52px; width: 100%; }
  .smart-popular { align-items: flex-start; }
  .smart-popular > span { flex-basis: 100%; }
  .smart-search-help { font-size: 0.72rem; }
  .smart-suggestions { left: -1px; right: -1px; }
  .smart-filter-bar { grid-template-columns: 1fr; margin-top: 14px; }
  .smart-check, #smart-clear-filters { justify-content: flex-start; min-height: 40px; }
  .smart-results-header { align-items: flex-start; display: grid; gap: 5px; }
  .smart-results-header > p { max-width: none; text-align: left; }
  .smart-result-grid { grid-template-columns: 1fr; }
  .smart-result-card { min-height: 0; padding: 17px; }
  .smart-result-head { grid-template-columns: 42px minmax(0, 1fr) auto; }
  .smart-result-icon { height: 42px; width: 42px; }
  .smart-result-card h3 { font-size: 1.14rem; }
  .smart-result-rating-row { margin-left: 54px; }
  .smart-directory-dock form { grid-template-columns: minmax(0, 1fr) minmax(104px, 0.42fr) auto; padding: 8px 0; }
  .smart-directory-dock form > button { font-size: 0; gap: 0; min-width: 52px; padding: 0; }
  .smart-directory-dock form > button span { font-size: 1rem; }
  #smart-dock-sort { font-size: 0.74rem; padding-left: 8px; padding-right: 24px; }
  .smart-dock-results { left: 10px; right: 10px; }
  .smart-dock-results > div:not(.smart-dock-alternatives) { grid-template-columns: 1fr; }
  .smart-dock-results > div > a:nth-child(odd) { border-right: 0; }
}

.smart-dock-fallback {
  margin: 0;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(17, 17, 17, 0.16);
  background: #fff0e5;
  font-size: 0.82rem;
  font-weight: 700;
}
