/* Public smart search: input, dialogue and service suggestions. */
.header-work-list { position: relative; flex: none; }
.site-header:has(#smart-list-header:not([hidden])) { position: sticky; top: 0; z-index: 40; }
.site-header:has(#smart-list-header:not([hidden])) .header-meta { margin-left: auto; }
.header-work-list-toggle {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 44px; padding: 8px 12px; color: var(--brand-dark); background: #f0f5ff;
  border: 1px solid #ccdaf7; border-radius: 12px; font-size: 13px; font-weight: 650; cursor: pointer;
}
.header-work-list-toggle:hover, .header-work-list-toggle[aria-expanded="true"] { background: #e5eeff; border-color: #8aaff4; }
.header-work-list-count { display: grid; place-items: center; min-width: 24px; height: 24px; padding-inline: 5px; color: #fff; background: var(--brand); border-radius: 8px; font-size: 12px; }
.header-work-list-popover {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 1;
  width: min(430px, calc(100vw - 32px)); max-height: min(640px, calc(100dvh - 120px)); overflow: auto; overscroll-behavior: contain;
  padding: 18px; color: #20364d; background: #fff; border: 1px solid #d5e0ef;
  border-radius: 16px; box-shadow: 0 12px 36px rgb(29 64 115 / 16%); text-align: left;
}
.header-work-list-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.header-work-list-heading h2 { margin: 0; font-size: 18px; }
#smart-list-close { flex: none; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 9px; background: #f0f5fb; color: var(--brand-dark); font-size: 25px; cursor: pointer; }
.header-work-list-popover ul { margin: 0 0 14px; padding: 0; list-style: none; }
.header-work-list-popover li { gap: 10px; padding: 12px 0; border-bottom: 1px solid #edf1f6; overflow-wrap: anywhere; }
.header-work-list-popover strong { font-size: 14px; line-height: 1.5; font-weight: 600; }
.header-work-list-popover small { color: #62758d; font-size: 12px; }
.header-work-list button:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
#smart-list-popover #smart-work-list, #smart-list-popover #selected-services { margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; font-size: 13px; }
#smart-list-popover #selected-services:not([hidden]) { display: block; }
#smart-list-heading { margin: 0 0 4px; color: #62758d; font-size: 13px; font-weight: 600; }
#smart-list-popover #smart-work-list:has(+ #selected-services:not([hidden])) { margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid #d5e0ef; }
#smart-list-popover .smart-list-actions { display: grid; gap: 10px; }
#smart-list-popover .smart-list-actions .btn { width: 100%; min-width: 0; padding: 10px; font-size: 13px; }
#smart-list-popover select { width: 100%; min-width: 0; box-sizing: border-box; padding: 8px; border: 1px solid #bdcee5; border-radius: 8px; background: white; color: #20364d; font: inherit; }
#smart-list-popover #selected-services .selected-services-list { display: grid; grid-template-columns: 1fr; gap: 0; }
#smart-list-popover #selected-services .selected-service-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; padding: 12px 0; border: 0; border-bottom: 1px solid #edf1f6; border-radius: 0; background: transparent; }
#smart-list-popover .selected-service-info { display: grid; gap: 5px; min-width: 0; overflow-wrap: anywhere; }
#smart-list-popover .selected-service-info b { font-size: 14px; line-height: 1.5; font-weight: 600; }
#smart-list-popover #selected-services .selected-item-actions { display: flex; justify-content: space-between; gap: 10px; margin: 0; }
#smart-list-popover .selected-item-actions button { min-width: 36px; min-height: 36px; padding: 6px 10px; color: var(--brand-dark); border: 1px solid #bdcee5; border-radius: 8px; background: white; font: inherit; cursor: pointer; }
#smart-list-popover .selected-order-bar { display: grid; gap: 12px; margin-top: 16px; }
#smart-list-popover .selected-order-total { display: flex; justify-content: space-between; gap: 8px; }
#smart-list-popover .selected-order-total > span { display: flex; flex-wrap: wrap; gap: 5px; }
#smart-list-popover .selected-order-bar .btn { width: 100%; }
body:has(.step[data-step="1"].active) .layout > .summary-column { display: none; }
body:has(#smart-list-header:not([hidden])) #smart-answer { scroll-margin-top: 125px; }
body[data-booking-step="6"] #smart-list-header { display: none; }
@media (max-width: 680px) {
  .site-header:has(#smart-list-header:not([hidden])) { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding-block: 9px; }
  .site-header:has(#smart-list-header:not([hidden])) .brand { grid-column: 1; grid-row: 1; }
  .site-header:has(#smart-list-header:not([hidden])) .header-meta { grid-column: 1 / -1; grid-row: 2; flex-direction: row; justify-content: space-between; align-items: center; width: 100%; gap: 12px; }
  .header-work-list { grid-column: 2; grid-row: 1; justify-self: end; }
  .header-work-list-toggle { padding: 8px 10px; }
  .header-work-list-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@media print { .header-work-list { display: none !important; } }

.smart-search-area {
  width: min(800px, 100%);
  margin: 26px auto 0;
  color: #20364d;
}
.smart-search-area .home-search { width: 100%; margin: 0; }
.smart-search-area .home-search-heading { margin: 0 0 9px; }
.smart-search-area .home-search-heading label { font-size: 15px; color: #263b51; }
.smart-search-area .home-search-field {
  padding: 6px;
  border-color: #c3d2e5;
  border-radius: 17px;
  box-shadow: 0 4px 18px rgb(27 54 92 / 5%);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.smart-search-area .home-search-field:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgb(37 99 235 / 10%), 0 8px 26px rgb(37 99 235 / 8%);
}
.smart-search-area .home-search-field:focus-within .home-search-icon { color: var(--brand); }
.smart-search-area .home-search-submit { gap: 9px; padding-inline: 19px; border-radius: 11px; }
.smart-search-area .home-search-submit span { display: inline; font-size: 14px; line-height: 1.3; }
.smart-search-area .home-search-submit svg { flex: none; width: 19px; height: 19px; }
.smart-search-area .search-clear { width: 44px; border-radius: 9px; }
.smart-search-area .search-clear:hover { color: var(--brand-dark); background: #edf3ff; }
.smart-search-area [hidden] { display: none; }
#smart-search-hint { margin: 10px 3px 0; color: #607086; font-size: 13px; line-height: 1.5; }
.smart-search-area .home-search:focus-within #smart-search-hint { color: #395b91; }

.smart-search-area .smart-answer {
  width: 100%;
  margin-top: 18px;
  padding: 22px;
  background: #fff;
  border: 1px solid #d5e0ef;
  border-radius: 20px;
  box-shadow: 0 12px 36px -18px rgb(29 64 115 / 18%);
  scroll-margin-block: 20px;
}
.smart-answer-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  color: #30465e;
  font-size: 14px;
  font-weight: 700;
}
.smart-assistant-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  color: var(--brand);
  background: #edf3ff;
  border-radius: 11px;
}
.smart-assistant-mark svg { width: 21px; height: 21px; }
.smart-answer-stage {
  margin-left: auto;
  padding: 5px 10px;
  border-radius: 20px;
  background: #f2f5fa;
  color: #526781;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}
#smart-answer[data-state="suggest"] .smart-answer-stage { color: #1d4ed8; background: #edf3ff; }
#smart-answer .smart-history-details { margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid #edf1f6; }
#smart-answer .smart-history-details summary { width: fit-content; padding: 10px 0; color: #5d718b; font-size: 12px; cursor: pointer; }
#smart-answer .smart-history-details summary:hover { color: var(--brand-dark); }
#smart-answer .smart-history-details summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; border-radius: 3px; }
#smart-answer .smart-history-details[open] summary { margin-bottom: 4px; }
#smart-answer #smart-history li { max-width: 90%; margin-bottom: 10px; padding: 9px 13px; border-radius: 13px; font-size: 13px; line-height: 1.55; }
#smart-answer #smart-history li:last-child { margin-bottom: 0; }
#smart-answer #smart-history li.user { color: #234474; background: #edf3ff; border-bottom-right-radius: 4px; }
#smart-answer #smart-history li.assistant { padding-left: 12px; color: #53667e; background: #f7f9fc; border-bottom-left-radius: 4px; }
#smart-answer #smart-history li span { margin-bottom: 3px; color: #536d91; font-size: 10px; letter-spacing: .02em; }
#smart-answer #smart-answer-text { color: #1e344c; font-size: 19px; line-height: 1.45; font-weight: 700; }
#smart-answer[data-state="pending"] #smart-answer-text { display: flex; align-items: center; gap: 12px; font-size: 16px; font-weight: 600; }
#smart-answer[data-state="pending"] #smart-answer-text::before {
  content: "";
  flex: none;
  width: 18px;
  height: 18px;
  box-sizing: border-box;
  border: 2px solid #dce7fa;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: smart-search-spin .8s linear infinite;
}
@keyframes smart-search-spin { to { transform: rotate(360deg); } }
#smart-answer .smart-answer-options { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
#smart-answer .smart-answer-options:not(:empty) { margin-top: 16px; }
#smart-answer .smart-answer-options :where(button) {
  min-width: 0;
  min-height: 46px;
  border-color: #d4dfed;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.45;
  transition: background .16s ease, border-color .16s ease;
}
#smart-answer[data-state="clarify"] .smart-answer-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#smart-answer .smart-choice { position: relative; padding: 13px 36px 13px 15px; color: #304e76; background: #fbfcff; }
#smart-answer .smart-choice::after { content: "›"; position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: #8399b7; font-size: 23px; line-height: 1; }
#smart-answer .smart-choice:last-child:nth-child(odd) { grid-column: 1 / -1; }
#smart-answer .smart-choice:hover { background: #edf3ff; border-color: #8caff4; }
#smart-answer .smart-choice:hover::after { color: var(--brand); }
#smart-answer .smart-result-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; border: 1px solid #bfd1f2; border-radius: 15px; overflow: hidden; }
#smart-answer .smart-work { grid-template-columns: minmax(0, 1fr) 36px; gap: 6px 16px; padding: 18px; background: #f5f8ff; border: 0; border-radius: 0; }
#smart-answer .smart-work:hover { background: #eaf1ff; }
#smart-answer .smart-work strong { color: #203e6c; font-size: 18px; line-height: 1.45; }
#smart-answer .smart-work-detail { grid-column: 1; color: #446799; font-size: 12px; line-height: 1.5; font-weight: 400; }
#smart-answer .smart-work > span { grid-column: 2; grid-row: 1 / span 2; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: #fff; background: var(--brand); font-size: 21px; }
#smart-answer .smart-add-work { justify-self: start; margin: 3px 10px; padding: 8px; color: #536b8a; background: transparent; border-color: transparent; font-size: 13px; }
#smart-answer .smart-add-work::before { content: "+"; display: inline-block; margin-right: 7px; color: #466999; font-size: 18px; vertical-align: -1px; }
#smart-answer .smart-add-work:hover { color: var(--brand-dark); background: #f1f5ff; }
#smart-answer .smart-search-alternative { justify-self: start; padding: 8px 0; color: #5b6c83; background: transparent; border-color: transparent; font-size: 13px; text-decoration: underline; text-underline-offset: 4px; }
#smart-answer .smart-search-alternative:hover { color: var(--brand-dark); }
#smart-answer .smart-consultation-action { justify-self: start; padding-inline: 20px; color: #fff; background: var(--booking-gradient); border-color: var(--brand); }
#smart-answer .smart-consultation-action:hover { background: var(--booking-gradient-hover); }
#smart-answer .smart-open-service { padding: 12px 18px; color: #fff; background: var(--booking-gradient); border-color: var(--brand); }
#smart-answer .smart-open-service:hover { background: var(--booking-gradient-hover); }
#questions .smart-show-service-variants { justify-self: start; padding: 9px 12px; margin-top: 12px; border: 1px solid #bdcee5; border-radius: 9px; color: var(--brand-dark); background: white; font: inherit; font-size: 13px; cursor: pointer; }
#smart-answer #smart-reply-form { margin-top: 20px; padding-top: 16px; border-top: 1px solid #edf1f6; }
#smart-answer #smart-reply-form label { margin-bottom: 8px; color: #5b6c83; font-size: 12px; font-weight: 400; }
#smart-answer .smart-reply-row { gap: 9px; }
#smart-answer #smart-reply { padding: 11px 13px; border-color: #cddaea; border-radius: 11px; }
#smart-answer #smart-reply:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgb(37 99 235 / 10%); }
#smart-answer .smart-answer-help { gap: 8px 18px; padding-top: 8px; }
.smart-search-area button:focus-visible, .smart-search-area a:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
#smart-answer .smart-work:focus-visible { outline-offset: -3px; border-radius: 12px; }
#smart-answer .smart-add-work:focus-visible { outline-offset: 0; }
.smart-search-area .smart-work-list { background: #fafcff; }
.has-selected-services .smart-search-area { margin-top: 0; }
/* The catalog tabs remain an exit from the dialogue, without a competing input. */
.step[data-step="1"]:has(#smart-answer:not([hidden])) #catalog-search-form,
.step[data-step="1"]:has(#smart-answer:not([hidden])) #service-categories { display: none; }

@media (max-width: 680px) {
  .smart-search-area { margin-top: 20px; }
  .smart-search-area .smart-answer { padding: 17px; border-radius: 17px; }
  #smart-answer #smart-answer-text { font-size: 18px; }
  #smart-answer[data-state="clarify"] .smart-answer-options { grid-template-columns: minmax(0, 1fr); }
  #smart-answer .smart-work { padding: 15px; gap: 7px 12px; }
  #smart-answer .smart-work strong { font-size: 16px; }
  .smart-search-area .home-search-submit { padding-inline: 14px; }
}
@media (max-width: 480px) {
  .smart-search-area .home-search-field { gap: 1px; padding: 5px; border-radius: 14px; }
  .smart-search-area .home-search-icon { display: none; }
  .smart-search-area .home-search-field input { padding-left: 9px; }
  .smart-search-area .home-search-submit { gap: 6px; padding-inline: 12px; }
  .smart-search-area .search-submit-detail, .smart-search-area .smart-reply-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  #smart-search-hint { font-size: 12px; }
  .smart-answer-heading { flex-wrap: wrap; gap: 8px; margin-bottom: 16px; font-size: 13px; }
  .smart-answer-stage { padding: 4px 7px; font-size: 10px; }
  .smart-assistant-mark { width: 30px; height: 30px; border-radius: 9px; }
  #smart-answer #smart-history li { max-width: 95%; }
  #smart-answer .smart-reply-row button { min-width: 46px; padding-inline: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .smart-search-area *, .smart-search-area *::before { animation: none !important; transition: none !important; }
}
