#ct-semantic {
  margin: 18px 0 22px;
  padding: 16px;
  border: 1px solid rgba(34, 159, 255, .45);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(12, 43, 75, .95), rgba(4, 20, 38, .96));
  box-shadow: 0 10px 30px rgba(0, 0, 0, .22);
  color: #eef8ff;
}

#ct-semantic * {
  box-sizing: border-box;
}

.ct-semantic-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 5px;
  font-size: 18px;
  font-weight: 700;
}

.ct-semantic-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, #06c7ee, #1477ff);
  box-shadow: 0 0 18px rgba(6, 199, 238, .32);
}

.ct-semantic-description {
  margin: 0 0 14px;
  color: #99aec3;
  font-size: 13px;
  line-height: 1.4;
}

.ct-semantic-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.ct-semantic-input,
.ct-semantic-select,
.ct-semantic-date {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid #23517b;
  border-radius: 12px;
  outline: none;
  background: #071c30;
  color: #f4fbff;
  font: inherit;
}

.ct-semantic-input:focus,
.ct-semantic-select:focus,
.ct-semantic-date:focus {
  border-color: #05c8ef;
  box-shadow: 0 0 0 3px rgba(5, 200, 239, .12);
}

.ct-semantic-input::placeholder {
  color: #718ba3;
}

.ct-semantic-actions {
  display: grid;
  grid-template-columns: 1fr 125px;
  gap: 10px;
  margin-top: 10px;
}

.ct-semantic-button {
  min-height: 46px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #08bee7, #1875f4);
  color: white;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.ct-semantic-button:disabled {
  opacity: .55;
}

.ct-semantic-clear {
  min-height: 46px;
  border: 1px solid #315a7f;
  border-radius: 12px;
  background: #102a45;
  color: #bed2e4;
  font: inherit;
  cursor: pointer;
}

.ct-semantic-status {
  display: none;
  margin: 13px 2px 0;
  color: #a9bdd0;
  font-size: 13px;
}

.ct-semantic-status.visible {
  display: block;
}

.ct-semantic-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 15px;
}

.ct-semantic-card {
  overflow: hidden;
  border: 1px solid #173f62;
  border-radius: 15px;
  background: #061a2c;
}

.ct-semantic-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #0c2740;
}

.ct-semantic-card-body {
  padding: 10px;
}

.ct-semantic-label {
  color: #f5fbff;
  font-size: 14px;
  font-weight: 700;
}

.ct-semantic-camera,
.ct-semantic-time {
  margin-top: 4px;
  color: #91a9bd;
  font-size: 12px;
}

@media (min-width: 700px) {
  .ct-semantic-row {
    grid-template-columns: 1fr 180px 155px;
  }

  .ct-semantic-actions {
    grid-template-columns: 180px 125px;
    justify-content: end;
  }

  .ct-semantic-results {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Correção visual: impede textos da página de aparecerem atrás */
#ct-semantic {
  background: #071f36 !important;
  backdrop-filter: none !important;
}

/* Busca inteligente ocupando proporcionalmente a tela */
#ct-semantic {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  margin: 18px 0 22px !important;
}

@media (max-width: 699px) {
  #ct-semantic {
    padding: 14px !important;
    border-radius: 18px !important;
  }

  .ct-semantic-title {
    margin-bottom: 12px !important;
  }

  .ct-semantic-actions {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  }

  .ct-semantic-button,
  .ct-semantic-clear {
    width: 100% !important;
    padding: 0 10px !important;
  }
}

/* Imagem ampliada da busca semântica */
.ct-semantic-image {
  cursor: zoom-in;
}

.ct-semantic-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background: rgba(0, 8, 18, .97);
  overscroll-behavior: contain;
}

.ct-semantic-overlay-image {
  display: block;
  width: 100%;
  max-width: 100vw;
  max-height: calc(100vh - 20px);
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 0 35px rgba(0, 0, 0, .7);
}

.ct-semantic-overlay-close {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: 14px;
  z-index: 1000000;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .4);
  border-radius: 50%;
  background: rgba(3, 21, 38, .9);
  color: #fff;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
}
