.tmgd-ss-host {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}

.tmgd-ss-host > .search-field {
  width: 100%;
}

.tmgd-ss-panel {
  position: absolute;
  z-index: 999999;
  top: calc(100% + 7px);
  right: auto;
  left: 0;
  width: 100%;
  min-width: 100%;
  box-sizing: border-box;
  max-height: min(620px, 75vh);
  overflow-y: auto;
  color: #171717;
  background: #fff;
  border: 1px solid #d7d7d7;
  border-radius: 8px;
  box-shadow: 0 14px 35px rgba(0, 0, 0, .24);
}

.tmgd-ss-panel[hidden] {
  display: none !important;
}

.tmgd-ss-filters {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  background: #f5f5f5;
  border-bottom: 1px solid #ddd;
  font-size: 11px;
}

.tmgd-ss-filters__caption {
  color: #666;
  font-weight: 600;
}

.tmgd-ss-filter {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  color: #222;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.tmgd-ss-filter input {
  width: 13px;
  height: 13px;
  margin: 0;
  accent-color: #e7aa00;
}

.tmgd-ss-filter:has(input:disabled) {
  cursor: default;
}

.tmgd-ss-result {
  display: flex;
  gap: 12px;
  min-height: 96px;
  padding: 10px;
  color: inherit;
  text-decoration: none;
  background: #fff;
  border-bottom: 1px solid #ececec;
  transition: background-color .12s ease;
}

.tmgd-ss-result:hover,
.tmgd-ss-result:focus,
.tmgd-ss-result.is-active {
  color: inherit;
  background: #fff6d8;
  outline: none;
}

.tmgd-ss-cover {
  display: block;
  flex: 0 0 58px;
  width: 58px;
  height: 82px;
  overflow: hidden;
  background: #eee;
  border-radius: 5px;
}

.tmgd-ss-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tmgd-ss-body {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.tmgd-ss-title {
  display: -webkit-box;
  overflow: hidden;
  color: #111;
  font-size: 14px;
  line-height: 1.3;
  text-align: left;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.tmgd-ss-meta {
  margin-top: 6px;
  color: #666;
  font-size: 12px;
  line-height: 1.2;
}

.tmgd-ss-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
}

.tmgd-ss-empty {
  padding: 22px 0 28px;
}

.tmgd-ss-empty__copy {
  position: relative;
  padding: 28px 230px 28px 28px;
  background: #f7f7f7;
  border: 1px solid #e2e2e2;
  border-left: 5px solid #ffbd00;
  border-radius: 8px;
}

.tmgd-ss-empty h2 {
  margin: 0 0 8px;
  font-size: 25px;
  line-height: 1.25;
}

.tmgd-ss-empty p {
  margin: 0;
  color: #555;
  font-size: 14px;
}

.tmgd-ss-request {
  position: absolute;
  top: 50%;
  right: 25px;
  padding: 13px 18px;
  color: #111;
  background: #ffbd00;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-50%);
}

.tmgd-ss-request:hover,
.tmgd-ss-request:focus {
  color: #111;
  background: #e9ab00;
}

.tmgd-ss-related {
  margin-top: 30px;
}

.tmgd-ss-related h3 {
  margin-bottom: 14px;
  font-size: 21px;
}

.tmgd-ss-related__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.tmgd-ss-related__item {
  display: flex;
  gap: 12px;
  min-width: 0;
  padding: 10px;
  color: #111;
  background: #fff;
  border: 1px solid #e2e2e2;
  border-radius: 7px;
  text-decoration: none;
}

.tmgd-ss-related__item:hover,
.tmgd-ss-related__item:focus {
  color: #111;
  background: #fff8e3;
  border-color: #ffbd00;
}

.tmgd-ss-related__item img {
  flex: 0 0 55px;
  width: 55px;
  height: 78px;
  object-fit: cover;
  border-radius: 4px;
}

.tmgd-ss-related__item > span {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
}

.tmgd-ss-related__item strong {
  display: -webkit-box;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.tmgd-ss-related__item small {
  margin-top: 6px;
  color: #666;
  font-size: 11px;
}

.tmgd-ss-badges span {
  padding: 2px 5px;
  color: #fff;
  background: #3f4652;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
}

.tmgd-ss-status {
  padding: 22px 16px;
  color: #666;
  font-size: 13px;
  text-align: center;
}

.tmgd-ss-all {
  display: block;
  width: 100%;
  padding: 12px 15px;
  color: #111;
  background: #ffbd00;
  border: 0;
  border-radius: 0 0 7px 7px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.tmgd-ss-all:hover,
.tmgd-ss-all:focus {
  background: #e9ab00;
}

@media (max-width: 700px) {
  .tmgd-ss-panel {
    position: absolute;
    top: calc(100% + 7px);
    right: auto;
    left: 0;
    width: 100%;
    max-height: 70vh;
  }

  .tmgd-ss-empty__copy {
    padding: 22px;
  }

  .tmgd-ss-request {
    position: static;
    display: inline-block;
    margin-top: 18px;
    transform: none;
  }

  .tmgd-ss-related__grid {
    grid-template-columns: 1fr;
  }

  .tmgd-ss-filters {
    gap: 8px;
  }

  .tmgd-ss-filters__caption {
    display: none;
  }
}
