.videos-form {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(96, 165, 250, .26);
  border-radius: 10px;
  background:
    radial-gradient(circle at 100% 0, rgba(37, 99, 235, .14), transparent 38%),
    linear-gradient(160deg, rgba(20, 29, 44, .98), rgba(12, 18, 30, .99));
  box-shadow:
    0 20px 50px rgba(3, 10, 24, .28),
    inset 0 1px 0 rgba(255, 255, 255, .04);
}

.videos-form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(96, 165, 250, .16);
}

.videos-form-head h2 {
  margin: 0;
  color: var(--hx-workbench-text, #e8f1ff);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
}

.videos-form-head p {
  margin: 4px 0 0;
  color: var(--hx-workbench-text-muted, #8aa0b8);
  font-size: 12px;
}

.videos-form-head > span {
  flex: 0 0 auto;
  padding: 4px 8px;
  border: 1px solid rgba(96, 165, 250, .2);
  border-radius: 999px;
  color: #9cc7ff;
  font-size: 11px;
  line-height: 1.2;
}

.videos-form-body {
  display: grid;
  align-content: start;
  gap: 18px;
  min-height: 0;
  padding: 20px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(96, 165, 250, .3) transparent;
}

.videos-field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.videos-field-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--hx-workbench-text, #e8f1ff);
  font-size: 13px;
  font-weight: 700;
}

.videos-field-title em {
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(59, 130, 246, .12);
  color: #9cc7ff;
  font-size: 10px;
  font-style: normal;
  font-weight: 500;
}

.videos-field--compact {
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
}

.videos-field--compact .videos-field-title {
  display: grid;
  justify-items: start;
  align-content: center;
  min-height: 42px;
}

.videos-field-control {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.videos-field-help {
  color: var(--hx-workbench-text-muted, #8aa0b8);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.5;
}

.videos-media-field {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(96, 165, 250, .18);
  border-radius: 8px;
  background: rgba(255, 255, 255, .025);
}

.videos-media-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.videos-media-head .videos-field-title {
  display: grid;
  justify-items: start;
  gap: 3px;
}

.videos-upload-button {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid rgba(96, 165, 250, .28);
  border-radius: 6px;
  background: rgba(59, 130, 246, .1);
  color: #9cc7ff;
  font-size: 11px;
  cursor: pointer;
}

.videos-upload-button:hover,
.videos-upload-button:focus-visible {
  border-color: rgba(96, 165, 250, .5);
  background: rgba(59, 130, 246, .18);
  outline: 0;
}

.videos-upload-button:disabled {
  opacity: .55;
  cursor: progress;
}

.videos-upload-list {
  display: flex;
  min-height: 42px;
  flex-wrap: wrap;
  gap: 8px;
}

.videos-upload-empty {
  display: flex;
  align-items: center;
  color: var(--hx-workbench-text-muted, #8aa0b8);
  font-size: 11px;
  line-height: 1.4;
}

.videos-upload-item {
  position: relative;
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: center;
  gap: 9px;
  padding: 7px 38px 7px 7px;
  border: 1px solid rgba(96, 165, 250, .16);
  border-radius: 7px;
  background: rgba(255, 255, 255, .035);
}

.videos-upload-thumb {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  overflow: hidden;
  border-radius: 6px;
  background: rgba(59, 130, 246, .1);
  color: #9cc7ff;
  font-size: 20px;
}

.videos-upload-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.videos-upload-meta {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.videos-upload-name {
  overflow: hidden;
  color: var(--hx-workbench-text, #e8f1ff);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.videos-upload-size {
  color: var(--hx-workbench-text-muted, #8aa0b8);
  font-size: 10px;
}

.videos-upload-remove {
  position: absolute;
  top: 50%;
  right: 8px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--hx-workbench-text-muted, #8aa0b8);
  font-size: 18px;
  line-height: 1;
  transform: translateY(-50%);
  cursor: pointer;
}

.videos-upload-remove:hover,
.videos-upload-remove:focus-visible {
  background: rgba(239, 68, 68, .12);
  color: #fca5a5;
  outline: 0;
}

.videos-form input,
.videos-form select,
.videos-form textarea {
  box-sizing: border-box;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--hx-workbench-border, rgba(92, 146, 201, .24));
  border-radius: 8px;
  background: var(--hx-workbench-control, rgba(255, 255, 255, .04));
  color: var(--hx-workbench-text, #e8f1ff);
  font: inherit;
}

.videos-form textarea {
  min-height: 180px;
  resize: vertical;
  line-height: 1.6;
}

.videos-form input:focus,
.videos-form select:focus,
.videos-form textarea:focus {
  outline: 2px solid rgba(59, 130, 246, .45);
  outline-offset: 1px;
}

.videos-input-unit {
  position: relative;
  display: block;
}

.videos-input-unit input {
  padding-right: 38px;
}

.videos-input-unit > span {
  position: absolute;
  top: 50%;
  right: 12px;
  color: var(--hx-workbench-text-muted, #8aa0b8);
  font-size: 12px;
  transform: translateY(-50%);
  pointer-events: none;
}

.videos-form-actions {
  display: grid;
  gap: 10px;
  padding: 16px 20px 18px;
  border-top: 1px solid rgba(96, 165, 250, .14);
  background: rgba(4, 10, 20, .18);
}

.videos-submit {
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  background: var(--hx-workbench-ai-gradient, linear-gradient(120deg, #1769e8, #08a4c7));
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.videos-submit:disabled {
  opacity: .6;
  cursor: progress;
}

.videos-hint {
  margin: 0;
  color: var(--hx-workbench-text-muted, #8aa0b8);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.videos-result {
  display: flex;
  align-content: flex-start;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
  height: 100%;
  padding: 20px;
  overflow: auto;
  text-align: center;
}

.videos-result-card {
  position: relative;
  width: min(240px, 100%);
  max-width: 240px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgba(96, 165, 250, .24);
  border-radius: 10px;
  background: #020817;
  box-shadow: 0 10px 28px rgba(3, 10, 24, .24);
  transition: width .2s ease, max-width .2s ease;
}

.videos-result-card video,
.videos-result-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.videos-result-card.is-expanded {
  width: min(100%, 760px);
  max-width: 100%;
  aspect-ratio: auto;
  padding: 10px;
}

.videos-result-card.is-expanded video {
  max-height: calc(100vh - 260px);
  pointer-events: auto;
}

.videos-result-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0;
  background: linear-gradient(180deg, transparent 35%, rgba(2, 8, 23, .44));
  cursor: pointer;
}

.videos-result-play:hover,
.videos-result-play:focus-visible {
  background: linear-gradient(180deg, rgba(23, 105, 232, .08), rgba(2, 8, 23, .58));
  outline: 0;
}

.videos-result-play-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .36);
  border-radius: 50%;
  background: rgba(8, 20, 40, .76);
  box-shadow: 0 8px 24px rgba(2, 8, 23, .34);
}

.videos-result-play-icon::before {
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 13px solid #fff;
  content: "";
  transform: translateX(2px);
}

.videos-result-collapse {
  position: absolute;
  top: 18px;
  right: 18px;
  display: none;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 6px;
  background: rgba(2, 8, 23, .78);
  color: #e8f1ff;
  font-size: 12px;
  cursor: pointer;
}

.videos-result-card.is-expanded .videos-result-play {
  display: none;
}

.videos-result-card.is-expanded .videos-result-collapse {
  display: block;
}

.videos-result-collapse:hover,
.videos-result-collapse:focus-visible {
  border-color: rgba(96, 165, 250, .6);
  outline: 0;
}

.videos-result:has(.videos-result-card.is-expanded) {
  align-items: center;
}

.videos-result video,
.videos-result img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
}

.videos-empty {
  margin: auto;
  color: var(--hx-workbench-text-muted, #8aa0b8);
}

.videos-download {
  width: 100%;
  color: #8cb9f1;
  font-size: 13px;
}

@media (max-width: 980px) {
  .videos-form {
    height: auto;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .videos-form-head,
  .videos-field-help {
    display: none;
  }

  .videos-form-body {
    gap: 14px;
    padding: 18px;
  }

  .videos-field--compact {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .videos-field--compact .videos-field-title {
    display: flex;
    min-height: 0;
    justify-content: space-between;
  }

  .videos-form textarea {
    min-height: 150px;
  }

  .videos-form-actions {
    padding: 0 18px 18px;
    border-top: 0;
    background: transparent;
  }

  .videos-result {
    padding: 16px;
  }

  .videos-result-card {
    width: min(220px, 100%);
    max-width: min(220px, 100%);
  }

  .videos-result-card.is-expanded {
    width: 100%;
    max-width: 100%;
  }
}
