.topsearch-section {
  padding: 35px 0;
}

.topsearch-section .container {
  max-width: 1300px !important;
}

.topsearch-section .ts-box {
  display: flex;
  align-items: center;
  gap: 35px;
  padding: 20px 25px;
  border-radius: 15px;
  background: linear-gradient(135deg, #ffffff 0%, #f0faff 100%);
  border: 1px solid #c9e9fa;
  box-shadow: 0 6px 22px rgba(19, 159, 223, 0.05);
}

.topsearch-section .ts-lab {
  flex: 0 0 36%;
  min-width: 0;
}

.topsearch-section .ts-ictop {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 14px;
  margin-bottom: 8px;
  border-radius: 30px;
  background: #e5efff;
  color: #0862ff;
  font-size: 14px;
  font-weight: 500;
}

.topsearch-section .ts-ictop::before {
  content: "✦";
  font-size: 20px;
  line-height: 1;
}

.topsearch-section .ts-title {
  margin-bottom: 3px;
  color: #064bb7;
  font-size: clamp(24px, 2.4vw, 32px);
  font-weight: 600;
  line-height: 1.3;
}

.topsearch-section .ts-hint {
  color: #617c9f;
  font-size: 15px;
  line-height: 1.6;
}

.topsearch-section .ts-form {
  flex: 1;
  min-width: 0;
}

.topsearch-section .ts-search-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.topsearch-section .ts-input {
  position: relative;
  flex: 1;
  min-width: 0;
}

.topsearch-section .ts-input::before,
.topsearch-section .ts-input::after {
  content: none;
}

.topsearch-section .ts-input > i {
  position: absolute;
  top: 50%;
  left: 18px;
  transform: translateY(-50%);
  color: #075bdf;
  font-size: 20px;
  pointer-events: none;
}

.topsearch-section .ts-input .form-control {
  box-sizing: border-box;
  width: 100%;
  height: 48px;
  padding: 10px 18px 10px 55px;
  border: 1px solid #d5e5ff;
  border-radius: 17px;
  background: #fff;
  color: #244568;
  font-family: inherit;
  font-size: 15px;
  box-shadow: 0 2px 7px rgba(45, 120, 230, 0.18);
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.topsearch-section .ts-input .form-control::placeholder {
  color: #8b99b0;
  font-style: italic;
}

.topsearch-section .ts-input .form-control:focus {
  outline: none;
  border-color: #70a7ff;
  box-shadow: 0 0 0 3px rgba(8, 98, 255, 0.12);
}

.topsearch-section .ts-submit {
  flex: 0 0 110px;
  border: 0;
  border-radius: 16px;
  background: #ee2842;
  outline: unset;
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.topsearch-section .ts-submit:hover {
  background: #d91e36;
}

.topsearch-section .ts-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 13px;
}

.topsearch-section .ts-tag {
  padding: 6px 17px;
  border: 0;
  border-radius: 30px;
  background: #e5eeff;
  color: #0054ee;
  outline: unset;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  cursor: pointer;
  transition: background 0.2s;
}

.topsearch-section .ts-tag:hover {
  background: #d3e2ff;
}

.topsearch-section .ts-submit:focus-visible,
.topsearch-section .ts-tag:focus-visible {
  outline: 2px solid #0862ff;
  outline-offset: 3px;
}

.topsearch-section .ts-tag.is-selected {
  background: #075bdf;
  color: #fff;
  box-shadow: inset 0 0 0 1px #075bdf;
}

.t4-search {
  --t4-red: #bd2029;
  --t4-primary: #e63242;
  --t4-blue: #12a6e5;
  --t4-ink: #172238;
  --t4-muted: #69768d;
  --t4-border: #d7dee9;
  position: fixed;
  inset: 0;
  z-index: 10550;
  color: var(--t4-ink);
  font-family: inherit;
  visibility: hidden;
  pointer-events: none;
  transition: visibility 0.28s;
}

.t4-search[hidden],
.t4-search [hidden] {
  display: none !important;
}

.t4-search *,
.t4-search *::before,
.t4-search *::after {
  box-sizing: border-box;
}

.t4-search button,
.t4-search input {
  font: inherit;
  outline: unset;
}

.t4-search button {
  cursor: pointer;
}

.t4-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 27, 46, 0.48);
  opacity: 0;
  transition: opacity 0.28s;
}

.t4-panel {
  position: absolute;
  right: 0;
  top: 0;
  width: min(760px, 100%);
  height: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #fff;
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.15);
  transform: translateX(100%);
  transition: transform 0.28s ease;
  outline: none;
}

.t4-search.is-open {
  visibility: visible;
  pointer-events: auto;
}

.t4-search.is-open .t4-backdrop {
  opacity: 1;
}

.t4-search.is-open .t4-panel {
  transform: translateX(0);
}

.t4-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 24px 28px;
  padding-top: max(24px, env(safe-area-inset-top));
  background: linear-gradient(90deg, #e63242 0%, #bd1f30 100%);
  color: #fff;
  flex-shrink: 0;
}

.t4-header h2 {
  margin: 0;
  font-size: 23px;
  font-weight: 600;
  line-height: 1.4;
  color: inherit;
}

.t4-header p {
  margin: 3px 0 0;
  font-size: 13px;
  line-height: 1.6;
}

.t4-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 50px;
  height: 50px;
  border: 7px solid #fff;
  border-radius: 50%;
  background: var(--t4-blue);
  font-weight: 700;
}

.t4-avatar-img {
  height: 60px;
  width: auto;
  margin-top: -10px;
  margin-bottom: -8px;
}

.t4-close {
  align-self: flex-start;
  margin-left: auto;
  flex: 0 0 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 30px !important;
  line-height: 1;
  border-radius: 8px;
}

.t4-close:hover {
  /* background: rgba(255, 255, 255, 0.15); */
  opacity: 0.8;
}

.t4-form {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  margin: 0;
}

.t4-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px 16px 24px 28px;
  scrollbar-gutter: stable;
}

.t4-label {
  display: block;
  font-size: 14px;
  margin-bottom: 9px;
  font-weight: 500;
}

.t4-input {
  position: relative;
}

.t4-input input {
  width: 100%;
  height: 54px;
  border: 2px solid var(--t4-blue);
  border-radius: 14px;
  padding: 12px 48px 12px 16px;
  background: #fff;
  color: var(--t4-ink);
  font-size: 16px;
}

.t4-input input::placeholder {
  color: #8794ab;
}

.t4-input i {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--t4-blue);
  pointer-events: none;
  font-size: 20px;
}

.t4-fieldset {
  border: 0;
  padding: 0;
  margin: 25px 0 0;
  min-width: 0;
}

.t4-fieldset legend {
  float: none;
  width: auto;
  margin: 0 0 12px;
  padding: 0;
  font-size: 16px;
  font-weight: 500;
}

.t4-fieldset small {
  font-size: 13px;
  color: var(--t4-muted);
  font-weight: 400;
  margin-left: 5px;
}

.t4-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.t4-business {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.t4-option {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  min-height: 42px;
  border: 1px solid #bac8dd;
  border-radius: 24px;
  padding: 9px 14px;
  background: #fff;
  color: var(--t4-ink);
  text-align: left;
  font-size: 14px !important;
  line-height: 1.5;
}

.t4-option:hover {
  background: #f7fafc;
  border-color: var(--t4-blue);
}

.t4-option.is-selected {
  background: #f3f9fd;
  border-color: var(--t4-blue);
}

.t4-option.is-selected::before {
  content: "\f058";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-style: normal;
  display: inline-block;
  flex: 0 0 17px;
  width: 17px;
  height: 17px;
  color: var(--t4-blue);
  background: transparent;
  border-radius: 0;
  font-size: 17px;
  line-height: 17px;
  text-align: center;
  -webkit-font-smoothing: antialiased;
}

.t4-footer {
  flex-shrink: 0;
  padding: 16px 28px max(20px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--t4-border);
  background: #fff;
}

.t4-selection-note {
  font-size: 13px;
  color: var(--t4-muted);
  margin-bottom: 10px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.t4-actions {
  display: flex;
  gap: 12px;
}

.t4-actions button {
  line-height: normal;
}

.t4-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 22px;
  border: 1px solid transparent;
  border-radius: 16px;
  font-size: 14px !important;
  font-weight: 500;
  text-align: center;
  line-height: 1.5;
  transition: all 0.12s;
}

.t4-actions .t4-button i {
  margin-right: 6px;
}

.t4-primary {
  background: var(--t4-primary);
  color: #fff;
  flex: 1;
}

.t4-primary:hover,
.t4-primary:active,
.t4-primary:focus {
  background: #cd2635;
  color: #fff;
}

.t4-secondary {
  background: #fff;
  border-color: #bac8dd;
  color: var(--t4-ink) !important;
}

.t4-secondary:hover {
  background: #f3f6fa;
}

.t4-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--t4-border);
  border-radius: 13px;
  padding: 10px;
  margin-bottom: 24px;
}

.t4-selected {
  display: flex;
  flex-wrap: wrap;
  flex: 1;
  gap: 6px;
  min-width: 0;
}

.t4-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: 9px;
  padding: 6px 9px;
  background: #eff3f9;
  color: #263b60;
  font-size: 12px !important;
  max-width: 100%;
  overflow-wrap: anywhere;
  text-align: left;
}

.t4-link {
  border: 0;
  background: none;
  color: var(--t4-red);
  padding: 8px;
  font-size: 13px !important;
  font-weight: 600;
}

.t4-result-group {
  margin-bottom: 24px;
}

.t4-group-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.t4-group-heading h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.5;
}

.t4-count {
  font-size: 12px;
  color: var(--t4-muted);
  flex-shrink: 0;
}

.t4-card {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) 108px;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--t4-border);
  border-left: 5px solid var(--t4-border);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.t4-card.t4-skele {
  border-left-color: #f5f5f5;
}
.t4-card.t4-group-0 {
  border-left-color: #2196b5;
}
.t4-card.t4-group-1 {
  border-left-color: #c46ba4;
}
.t4-card.t4-group-2 {
  border-left-color: #d99432;
}
.t4-card.t4-group-3 {
  border-left-color: #7953c6;
}
.t4-card.t4-group-4 {
  border-left-color: #448e79;
}
.t4-card.t4-group-5 {
  border-left-color: #9d7651;
}

.t4-card-cover {
  width: 104px;
  height: 104px;
  object-fit: cover;
  border-radius: 8px;
  background: #eef2f6;
  display: block;
}

.t4-cover-placeholder {
  display: grid;
  place-items: center;
  color: #8c9ab0;
  font-size: 12px;
}

.t4-card-title {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 7px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.t4-badge {
  display: inline-block;
  background: #eaf8fb;
  color: #39738a;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
}

.t4-meta {
  font-size: 12px;
  line-height: 1.3;
  color: var(--t4-muted);
  margin: 0;
}

.t4-card-action {
  text-align: right;
}

.t4-price {
  display: block;
  font-size: 18px;
  font-weight: 600;
  color: var(--t4-primary);
  margin-bottom: 10px;
}

.t4-details {
  min-height: 36px;
  padding: 7px 12px;
  border-radius: 20px;
  font-size: 12px !important;
}

.t4-more {
  width: 100%;
  background: #f3f6fa;
  border-color: var(--t4-border);
  color: #284068 !important;
  margin-top: 6px;
  border-radius: 24px;
}

.t4-more:hover {
  background: #e9ecf0;
}

.t4-contact {
  background: #00b900;
  border: unset;
  color: #fff !important;
  font-size: 15px !important;
}

.t4-contact:hover {
  background: #00b900;
  opacity: 0.8;
}

.t4-contact > img {
  width: 35px;
  margin: -20px 2px -20px -13px;
}

.t4-more.t4-contact {
  margin-top: 12px;
}

.t4-empty {
  padding: 44px 0;
  text-align: center;
}

.t4-empty-icon {
  display: grid;
  place-items: center;
  width: 110px;
  height: 110px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: #edf8fb;
  color: var(--t4-blue);
  font-size: 48px;
  font-weight: 600;
}

.t4-empty h3 {
  font-size: 20px;
  margin: 0 0 12px;
  line-height: 1.5;
}

.t4-empty p {
  font-size: 14px;
  color: var(--t4-muted);
  margin: 0 0 24px;
  line-height: 1.7;
}

.t4-empty .t4-actions {
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 15px;
}

.t4-empty .t4-primary {
  flex: initial;
}

.t4-skeleton {
  background: #edf0f5;
  position: relative;
  overflow: hidden;
  border-radius: 6px;
}

.t4-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.8),
    transparent
  );
  transform: translateX(-100%);
  animation: t4-shimmer 1.4s infinite;
}

.t4-skeleton-title {
  width: 42%;
  height: 20px;
  margin: 24px 0 12px;
}

.t4-skeleton-line {
  height: 12px;
  width: 100%;
  margin: 12px 0;
}

.t4-skeleton-line.short {
  width: 65%;
}

.t4-skeleton-price {
  height: 18px;
  margin-bottom: 14px;
}

.t4-skeleton-button {
  height: 34px;
  border-radius: 20px;
}

.t4-search :focus-visible {
  outline: 3px solid #219bda;
  outline-offset: 3px;
}

.t4-search button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.t4-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* labtop others */
@media (max-width: 991px) {
  .topsearch-section .ts-box {
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
    padding: 24px;
  }

  .topsearch-section .ts-lab {
    flex: auto;
  }
}

@keyframes t4-shimmer {
  to {
    transform: translateX(100%);
  }
}

/* mobile */
@media (max-width: 575px) {
  .topsearch-section {
    padding: 18px 0;
  }

  .topsearch-section .ts-box {
    padding: 18px 16px;
    gap: 16px;
    border-radius: 15px;
  }

  .topsearch-section .ts-ictop {
    gap: 4px;
    margin-bottom: 7px;
    font-size: 12px;
    line-height: 1.4;
  }

  .topsearch-section .ts-title {
    font-size: 21px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 5px;
    letter-spacing: -0.2px;
  }

  .topsearch-section .ts-hint {
    font-size: 13px;
    line-height: 1.5;
    font-weight: 400;
  }

  .topsearch-section .ts-search-row {
    gap: 8px;
  }

  .topsearch-section .ts-input > i {
    left: 14px;
    font-size: 17px;
  }

  .topsearch-section .ts-input .form-control {
    height: 45px;
    padding: 9px 12px 9px 43px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    border-radius: 12px;
    box-shadow: none;
  }

  .topsearch-section .ts-input .form-control::placeholder {
    font-size: 13px;
    font-weight: 400;
    font-style: normal;
    color: #95a3b7;
    opacity: 1;
  }

  .topsearch-section .ts-submit {
    flex: 0 0 75px;
    min-width: 75px;
    padding: 0 10px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
  }

  .topsearch-section .ts-tags {
    gap: 6px;
    margin-top: 11px;
  }

  .topsearch-section .ts-tag {
    padding: 6px 11px;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.35;
  }

  .topsearch-section .ts-input::before {
    left: 14px;
  }

  .topsearch-section .ts-input::after {
    left: 28px;
  }

  .t4-panel {
    width: 100%;
  }

  .t4-header {
    padding: 18px 16px;
    padding-top: max(18px, env(safe-area-inset-top));
    gap: 10px;
  }

  .t4-header h2 {
    font-size: 19px;
  }

  .t4-header p {
    font-size: 12px;
  }

  .t4-avatar {
    flex-basis: 43px;
    height: 43px;
    border-width: 6px;
  }

  .t4-avatar-img {
    height: 50px;
  }

  .t4-scroll {
    padding: 20px 16px;
  }

  .t4-footer {
    padding: 14px 16px max(16px, env(safe-area-inset-bottom));
  }

  .t4-footer .t4-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .t4-footer .t4-actions .t4-button {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 10px 8px;
    border-radius: 12px;
    font-size: 13px !important;
    white-space: nowrap;
    flex: none;
  }

  .t4-footer .t4-actions .t4-primary {
    grid-column: 1 / -1;
    min-height: 45px;
    font-size: 15px !important;
    font-weight: 500;
    border-radius: 14px;
  }

  .t4-footer .t4-actions .t4-button i {
    margin-right: 5px;
  }

  .t4-footer .t4-actions .t4-secondary {
    background: #f8fafc;
    border-color: #dce3ed;
    color: #506078;
  }

  .t4-footer .t4-actions .t4-secondary:active {
    background: #e8eef6;
  }

  .t4-business {
    grid-template-columns: 1fr;
  }

  .t4-business .t4-option {
    border-radius: 13px;
  }

  .t4-card {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 10px;
  }

  .t4-card-cover {
    width: 88px;
    height: 105px;
  }

  .t4-card-action {
    grid-column: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    text-align: left;
  }

  .t4-price {
    font-size: 17px;
    margin: 0;
    margin-right: 20px;
  }

  .t4-group-heading h3 {
    font-size: 16px;
  }

  .t4-button {
    padding: 10px 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .t4-search,
  .t4-backdrop,
  .t4-panel {
    transition: none;
  }

  .t4-skeleton::after {
    animation: none;
  }
}

/* Small success/error notices for clear selection and clear cache. */
.t4-mini-toast {
  position: absolute;
  z-index: 5;
  top: 112px;
  left: 50%;
  transform: translate(-50%, -8px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 10px 15px;
  border: 1px solid #c6e7db;
  border-radius: 12px;
  background: #f2fbf7;
  color: #17724f;
  box-shadow: 0 7px 24px rgba(21, 40, 55, 0.12);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}
.t4-mini-toast[hidden] {
  display: none !important;
}
.t4-mini-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
.t4-mini-toast i {
  font-size: 15px;
  flex: 0 0 auto;
}
.t4-mini-toast.is-error {
  border-color: #f1d2d6;
  background: #fff6f6;
  color: #ae3040;
}
@media (max-width: 575px) {
  .t4-mini-toast {
    top: 86px;
    padding: 9px 13px;
    font-size: 12px;
    border-radius: 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .t4-mini-toast {
    transition: none;
  }
}

/* Short package description under the title (from ai_description). */
.t4-card-desc {
  /* display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden; */
  margin: 0 0 7px;
  padding: 4px 7px;
  border-radius: 6px;
  background: #f3f5f8;
  color: #3a475c;
  font-size: 12.5px;
  line-height: 1.3;
}

/* AI reason: shown only for partial matches, under the city / dates / code row. */
.t4-note {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 7px 0 0;
  padding: 5px 8px;
  border: 1px solid #a9d3ff;
  border-left: 3px solid #1a8cff;
  border-radius: 8px;
  background: #e8f3ff;
  color: #0b4a8f;
  font-size: 12px;
  line-height: 1.5;
}

.t4-note-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 15px;
  width: 15px;
  height: 15px;
  margin-top: 2px;
  border-radius: 50%;
  background: #1a8cff;
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 10px;
  font-style: italic;
  font-weight: 700;
  line-height: 1;
}

.t4-note-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 575px) {
  .t4-card-desc {
    font-size: 12px;
  }

  .t4-note {
    margin-top: 7px;
    padding: 5px 8px 5px 7px;
    font-size: 11.5px;
    line-height: 1.3;
  }

  .t4-contact {
    width: 90%;
  }

  .t4-more.t4-contact {
    width: 100%;
  }
}
