/* Streaming-style video library inspired by Netwind (MIT): https://github.com/Jeycon/Netwind */

#ai-news.panel {
  padding: 0;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

#ai-news.panel.active {
  display: block;
}

body:has(#ai-news.panel.active) {
  padding-left: 0;
  padding-right: 0;
  background: var(--bg);
  overflow-y: scroll;
}

body:has(#ai-news.panel.active) .container {
  width: 100%;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  padding: 0 0 80px;
}

body:has(#ai-news.panel.active) .site-signature {
  display: none;
}

.ai-video-center {
  min-height: calc(100vh - 90px);
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --video-line: color-mix(in srgb, var(--line) 82%, transparent);
  --video-panel: var(--surface);
  --video-soft: var(--soft);
  --video-hover: color-mix(in srgb, var(--text) 6%, var(--surface));
  --video-muted: var(--muted);
  --video-dim: color-mix(in srgb, var(--muted) 72%, transparent);
  --video-yellow: #ffc106;
  --video-yellow-hover: #ffd13f;
  --video-yellow-text: #2d2400;
  transition: background-color 420ms ease, color 420ms ease;
}

.ai-video-loading {
  min-height: 360px;
  display: grid;
  place-items: center;
  color: var(--video-muted);
  font-size: 14px;
}

.ai-video-layout {
  width: min(1420px, calc(100vw - 40px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 28px;
}

.ai-video-main {
  min-width: 0;
}

.ai-video-shell {
  width: 100%;
  padding: 26px 0 52px;
}

.ai-video-creator-sidebar {
  position: sticky;
  top: 84px;
  align-self: start;
  max-height: calc(100vh - 104px);
  overflow-y: auto;
  padding: 26px 18px 26px 0;
  border-right: 1px solid var(--video-line);
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--text) 18%, transparent) transparent;
}

@media (min-width: 901px) {
  .ai-video-main {
    grid-column: 2;
  }

  .ai-video-creator-sidebar {
    position: fixed;
    top: 84px;
    left: max(20px, calc((100vw - 1420px) / 2));
    width: 220px;
    height: calc(100vh - 84px);
    max-height: none;
  }
}

.ai-video-creator-home,
.ai-video-creator-nav-item {
  width: 100%;
  min-width: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--video-muted);
  font: inherit;
  cursor: pointer;
  text-align: left;
  transition: background-color .16s ease, color .16s ease;
}

.ai-video-creator-home {
  height: 44px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 850;
}

.ai-video-favorites-nav {
  margin-top: 5px;
}

.ai-video-favorites-nav small {
  min-width: 22px;
  margin-left: auto;
  color: var(--video-dim);
  font-size: 11px;
  font-weight: 850;
  text-align: right;
}

.ai-video-favorites-nav.active small {
  color: var(--video-muted);
}

.ai-video-creator-home svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
}

.ai-video-creator-home:hover,
.ai-video-creator-home.active,
.ai-video-creator-nav-item:hover,
.ai-video-creator-nav-item.active {
  background: var(--video-soft);
  color: var(--text);
}

.ai-video-creator-home.active,
.ai-video-creator-nav-item.active {
  box-shadow: inset 3px 0 0 var(--video-yellow);
}

.ai-video-creator-nav-label {
  margin: 24px 12px 9px;
  color: var(--video-dim);
  font-size: 11px;
  font-weight: 900;
}

.ai-video-creator-nav {
  display: grid;
  gap: 4px;
}

.ai-video-creator-nav-item {
  min-height: 58px;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
}

.ai-video-creator-nav-item > span:last-child {
  min-width: 0;
}

.ai-video-creator-nav-item strong,
.ai-video-creator-nav-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-video-creator-nav-item strong {
  color: inherit;
  font-size: 13px;
  line-height: 1.3;
}

.ai-video-creator-nav-item small {
  margin-top: 3px;
  color: var(--video-dim);
  font-size: 11px;
}

.ai-video-creator-avatar {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--video-soft);
  color: var(--text);
  font-weight: 900;
}

.ai-video-creator-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.ai-video-creator-avatar-small {
  width: 38px;
  height: 38px;
  font-size: 14px;
}

.ai-video-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 44px;
  margin-bottom: 16px;
}

.ai-video-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-left: auto;
}

.ai-video-search {
  flex: 0 1 340px;
  position: relative;
}

.ai-video-search input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--video-line);
  border-radius: 999px;
  padding: 0 15px 0 40px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  outline: none;
}

.ai-video-search input::placeholder {
  color: var(--video-dim);
}

.ai-video-search input:focus {
  border-color: rgba(243, 204, 79, 0.58);
  box-shadow: 0 0 0 3px rgba(243, 204, 79, 0.13);
}

.ai-video-search svg {
  position: absolute;
  left: 15px;
  top: 50%;
  width: 17px;
  height: 17px;
  transform: translateY(-50%);
  stroke: var(--video-muted);
}

.ai-video-upload-wrap {
  flex: 0 0 auto;
}

.ai-video-upload-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.ai-video-upload-btn {
  position: relative;
  height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(243, 204, 79, 0.54);
  border-radius: 999px;
  padding: 0 15px;
  background: var(--video-yellow);
  color: var(--video-yellow-text);
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  transition: transform .16s ease, background .16s ease, opacity .16s ease;
}

.ai-video-upload-btn:hover {
  transform: scale(1.03);
  background: var(--video-yellow-hover);
}

.ai-video-upload-btn:disabled,
.ai-video-upload-btn.is-disabled {
  cursor: wait;
  opacity: .72;
  transform: none;
}

.ai-video-upload-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

.ai-video-upload-status {
  flex: 0 1 360px;
  position: relative;
  overflow: hidden;
  min-height: 34px;
  border: 1px solid var(--video-line);
  border-radius: 999px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  background: var(--surface);
  color: var(--video-muted);
  font-size: 12px;
  font-weight: 800;
}

.ai-video-upload-status[hidden] {
  display: none;
}

.ai-video-upload-status span {
  position: relative;
  z-index: 1;
}

.ai-video-upload-status i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: rgba(243, 204, 79, 0.22);
  transition: width .14s linear;
}

.ai-video-upload-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: grid;
  place-items: center;
  padding: 18px;
}

.ai-video-upload-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(10px);
}

.ai-video-upload-card {
  position: relative;
  z-index: 1;
  width: min(700px, calc(100vw - 28px));
  max-height: min(900px, calc(100vh - 36px));
  overflow-y: auto;
  border: 1px solid var(--video-line);
  border-radius: 12px;
  padding: 18px;
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(0,0,0,.48);
}

.ai-video-upload-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.ai-video-upload-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 19px;
}

.ai-video-upload-head button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--video-line);
  border-radius: 50%;
  background: var(--video-soft);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.ai-video-upload-media-row {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(180px, .88fr);
  gap: 12px;
}

.ai-video-upload-drop {
  min-height: 142px;
  border: 1px dashed rgba(243, 204, 79, 0.52);
  border-radius: 10px;
  padding: 18px;
  display: grid;
  place-items: center;
  gap: 7px;
  background: rgba(243, 204, 79, 0.08);
  cursor: pointer;
  text-align: center;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.ai-video-cover-drop {
  min-height: 142px;
  border: 1px dashed var(--video-line);
  border-radius: 10px;
  padding: 12px;
  display: grid;
  place-items: center;
  gap: 7px;
  background: var(--video-soft);
  cursor: pointer;
  text-align: center;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.ai-video-upload-drop.is-dragover,
.ai-video-cover-drop.is-dragover {
  border-color: var(--video-yellow);
  background: rgba(243, 204, 79, 0.15);
  box-shadow: inset 0 0 0 1px rgba(243, 204, 79, 0.28), 0 0 0 3px rgba(243, 204, 79, 0.08);
}

.ai-video-upload-drop input,
.ai-video-cover-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.ai-video-upload-drop svg {
  width: 28px;
  height: 28px;
  stroke: var(--video-yellow);
}

.ai-video-cover-drop i {
  width: 100%;
  max-width: 128px;
  aspect-ratio: 323 / 430;
  overflow: hidden;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--bg);
  font-style: normal;
}

.ai-video-cover-preview {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.ai-video-cover-empty {
  color: var(--video-dim);
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
}

.ai-video-upload-drop strong,
.ai-video-cover-drop strong {
  max-width: 100%;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-video-upload-drop span,
.ai-video-cover-drop span {
  color: var(--video-muted);
  font-size: 12px;
}

.ai-video-upload-field {
  display: grid;
  gap: 7px;
  margin-top: 13px;
}

.ai-video-upload-field span {
  color: var(--video-muted);
  font-size: 12px;
  font-weight: 850;
}

.ai-video-upload-field input,
.ai-video-upload-field textarea,
.ai-video-upload-field select {
  width: 100%;
  border: 1px solid var(--video-line);
  border-radius: 9px;
  background: var(--video-soft);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  outline: none;
}

.ai-video-upload-field input {
  height: 42px;
  padding: 0 12px;
}

.ai-video-upload-field select {
  height: 42px;
  padding: 0 36px 0 12px;
}

.ai-video-upload-field textarea {
  min-height: 92px;
  resize: vertical;
  padding: 11px 12px;
  line-height: 1.55;
}

.ai-video-upload-field input:focus,
.ai-video-upload-field textarea:focus,
.ai-video-upload-field select:focus {
  border-color: rgba(243, 204, 79, 0.58);
  box-shadow: 0 0 0 3px rgba(243, 204, 79, 0.13);
}

.ai-video-creator-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  margin-top: 13px;
}

.ai-video-creator-picker .ai-video-upload-field {
  margin-top: 0;
}

.ai-video-creator-picker button {
  height: 42px;
  border: 1px solid rgba(243, 204, 79, .38);
  border-radius: 8px;
  padding: 0 14px;
  background: rgba(243, 204, 79, .1);
  color: color-mix(in srgb, #b98200 88%, var(--text));
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.ai-video-new-creator {
  margin-top: 12px;
  padding: 14px;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  border: 1px solid var(--video-line);
  border-radius: 8px;
  background: var(--video-soft);
}

.ai-video-creator-avatar-drop {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 8px;
  color: var(--video-muted);
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}

.ai-video-creator-avatar-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.ai-video-creator-avatar-drop i {
  width: 96px;
  height: 96px;
  overflow: hidden;
  border: 1px dashed rgba(243, 204, 79, .46);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(243, 204, 79, .07);
  color: var(--video-dim);
  font-style: normal;
  transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
}

.ai-video-creator-avatar-drop i img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.ai-video-creator-avatar-drop.is-dragover i {
  border-color: var(--video-yellow);
  background: rgba(243, 204, 79, .14);
  box-shadow: 0 0 0 3px rgba(243, 204, 79, .09);
}

.ai-video-new-creator-fields {
  min-width: 0;
}

.ai-video-new-creator-fields .ai-video-upload-field:first-child {
  margin-top: 0;
}

.ai-video-new-creator-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.ai-video-new-creator-save {
  min-height: 36px;
  border: 1px solid rgba(243, 204, 79, .54);
  border-radius: 999px;
  padding: 0 15px;
  background: var(--video-yellow);
  color: var(--video-yellow-text);
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.ai-video-new-creator-save:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.ai-video-upload-modal-status {
  position: relative;
  overflow: hidden;
  min-height: 34px;
  margin-top: 13px;
  border: 1px solid var(--video-line);
  border-radius: 999px;
  padding: 0 12px;
  display: none;
  align-items: center;
  color: var(--video-muted);
  font-size: 12px;
  font-weight: 800;
}

.ai-video-upload-modal-status.active {
  display: flex;
}

.ai-video-upload-modal-status span {
  position: relative;
  z-index: 1;
}

.ai-video-upload-modal-status i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: rgba(243, 204, 79, 0.24);
}

.ai-video-upload-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 16px;
}

.ai-video-upload-actions button {
  height: 40px;
  border-radius: 999px;
  padding: 0 16px;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.ai-video-upload-secondary {
  border: 1px solid var(--video-line);
  background: var(--video-soft);
  color: var(--text);
}

.ai-video-upload-primary {
  border: 1px solid rgba(243, 204, 79, 0.54);
  background: var(--video-yellow);
  color: var(--video-yellow-text);
}

.ai-video-upload-actions button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.ai-video-creator-profile {
  min-height: 190px;
  margin-bottom: 28px;
  padding: 20px 4px 28px;
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  align-items: center;
  gap: 26px;
  border-bottom: 1px solid var(--video-line);
}

.ai-video-creator-avatar-hero {
  width: 132px;
  height: 132px;
  font-size: 42px;
}

.ai-video-creator-profile-copy {
  min-width: 0;
}

.ai-video-creator-profile h1 {
  margin: 0;
  color: var(--text);
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.ai-video-creator-stats {
  margin-top: 8px;
  color: var(--video-dim);
  font-size: 12px;
  font-weight: 850;
}

.ai-video-creator-profile p {
  max-width: 720px;
  margin: 14px 0 0;
  color: var(--video-muted);
  font-size: 14px;
  line-height: 1.65;
}

.ai-video-creator-link {
  width: max-content;
  max-width: 100%;
  margin-top: 16px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: color-mix(in srgb, #d99f00 86%, var(--text));
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
}

.ai-video-creator-link:hover {
  color: color-mix(in srgb, #b98200 88%, var(--text));
  text-decoration: underline;
}

.ai-video-creator-link svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

.ai-video-featured {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 286px;
  gap: 0;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--video-line);
  border-radius: 10px;
  background: var(--video-panel);
  box-shadow: 0 28px 70px rgba(0,0,0,.34);
  margin-bottom: 30px;
}

.ai-video-featured-player {
  position: relative;
  aspect-ratio: 16 / 9;
  min-width: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: var(--art);
}

.ai-video-featured-player::before,
.ai-video-card-cover::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 18px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 8px;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.055) 0 1px, transparent 1px 88px);
  pointer-events: none;
}

.ai-video-featured-player video {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: none;
  object-fit: contain;
  background: #000;
}

.ai-video-featured-player.has-video {
  background: #000;
}

.ai-video-featured-cover,
.ai-video-card-cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.ai-video-featured-cover {
  z-index: 0;
}

.ai-video-featured-cover + video + .ai-video-featured-poster {
  background: linear-gradient(180deg, rgba(0,0,0,.08), rgba(0,0,0,.32));
}

.ai-video-featured-player.has-video video {
  display: block;
}

.ai-video-featured-poster {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  display: grid;
  place-items: center;
  background: transparent;
  cursor: pointer;
  z-index: 3;
}

.ai-video-featured-player.has-video .ai-video-featured-poster {
  display: none;
}

.ai-video-featured-poster span {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  color: #111214;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
  transition: transform .16s ease, background .16s ease;
}

.ai-video-featured-poster:hover span {
  transform: scale(1.05);
}

.ai-video-featured-poster svg {
  width: 35px;
  height: 35px;
  fill: currentColor;
  margin-left: 4px;
}

.ai-video-featured-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 20px;
  border: 0;
  border-left: 1px solid var(--video-line);
  border-radius: 0;
  background: var(--video-panel);
}

.ai-video-featured-cover-card {
  position: relative;
  width: 100%;
  aspect-ratio: 323 / 430;
  margin: auto auto 0;
  overflow: hidden;
  border: 1px solid var(--video-line);
  border-radius: 8px;
  background: var(--art);
}

.ai-video-featured-cover-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 66%, rgba(0,0,0,.24));
  pointer-events: none;
}

.ai-video-featured-cover-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.ai-video-card-progress {
  position: absolute;
  z-index: 5;
  top: 10px;
  right: 10px;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 999px;
  padding: 0 9px;
  background: rgba(8,9,11,.78);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  backdrop-filter: blur(8px);
  pointer-events: none;
}

.ai-video-card-progress[data-progress="complete"] {
  background: rgba(24,112,72,.88);
}

.ai-video-favorite-button {
  position: absolute;
  z-index: 6;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 50%;
  padding: 0;
  background: rgba(8,9,11,.78);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: transform .16s ease, background-color .16s ease, border-color .16s ease, color .16s ease;
}

.ai-video-favorite-button svg {
  width: 17px;
  height: 17px;
  fill: transparent;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ai-video-favorite-button:hover {
  transform: scale(1.08);
  border-color: var(--video-yellow);
  background: var(--video-yellow);
  color: var(--video-yellow-text);
}

.ai-video-favorite-button:active {
  transform: scale(.94);
}

.ai-video-favorite-button:focus-visible {
  outline: 2px solid var(--video-yellow);
  outline-offset: 2px;
}

.ai-video-favorite-button.active {
  border-color: var(--video-yellow);
  background: var(--video-yellow);
  color: var(--video-yellow-text);
}

.ai-video-favorite-button.active svg {
  fill: currentColor;
}

.ai-video-favorite-button:not(.active) svg {
  fill: transparent;
}

.ai-video-favorite-button:disabled {
  cursor: wait;
  opacity: .58;
  transform: none;
}

.ai-video-card-favorite,
.ai-video-featured-favorite {
  top: 10px;
  left: 10px;
}

.ai-video-hot-label {
  width: max-content;
  min-height: 25px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--video-yellow);
  color: var(--video-yellow-text);
  font-size: 12px;
  font-weight: 900;
}

.ai-video-featured-copy {
  min-width: 0;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  justify-items: start;
  align-items: center;
  gap: 12px 10px;
}

.ai-video-featured-copy .ai-video-card-meta {
  margin: 0;
}

.ai-video-featured-info h1 {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--text);
  font-size: 21px;
  line-height: 1.36;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.ai-video-grid-wrap {
  padding-top: 2px;
}

.ai-video-grid-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.ai-video-grid-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 19px;
}

.ai-video-grid-head-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

.ai-video-grid-count {
  flex: 0 0 auto;
  color: var(--video-dim);
  font-size: 12px;
  font-weight: 800;
}

.ai-video-grid-sort {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--video-line);
  border-radius: 7px;
  padding: 3px;
  background: var(--video-soft);
}

.ai-video-grid-sort button {
  min-width: 76px;
  height: 30px;
  border: 0;
  border-radius: 5px;
  padding: 0 10px;
  background: transparent;
  color: var(--video-muted);
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
  transition: background-color .16s ease, color .16s ease, box-shadow .16s ease;
}

.ai-video-grid-sort button:hover {
  color: var(--text);
}

.ai-video-grid-sort button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 5px color-mix(in srgb, #000 16%, transparent);
}

.ai-video-grid-sort button:focus-visible {
  outline: 2px solid var(--video-yellow);
  outline-offset: 1px;
}

.ai-video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
}

.ai-video-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--video-line);
  border-radius: 9px;
  background: var(--surface);
  color: inherit;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.ai-video-card:hover,
.ai-video-card.active {
  transform: translateY(-2px);
  border-color: rgba(243, 204, 79, 0.52);
  background: var(--video-hover);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.22);
}

.ai-video-card-cover {
  position: relative;
  aspect-ratio: 323 / 430;
  overflow: hidden;
  background: var(--art);
}

.ai-video-card-cover::before {
  inset: 12px;
  border-radius: 7px;
}

.ai-video-card-cover::after {
  content: attr(data-rank);
  position: absolute;
  right: 9px;
  bottom: 9px;
  padding: 4px 7px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  z-index: 3;
}

.ai-video-card-play {
  position: absolute;
  z-index: 3;
  left: 13px;
  bottom: 11px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  color: #111214;
}

.ai-video-card-feature {
  position: absolute;
  z-index: 4;
  top: 46px;
  right: 10px;
  height: 30px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 7px;
  padding: 0 10px;
  background: rgba(9,10,13,.82);
  color: #fff;
  font: inherit;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .16s ease, transform .16s ease, background-color .16s ease;
}

.ai-video-card:hover .ai-video-card-feature,
.ai-video-card:focus-within .ai-video-card-feature {
  opacity: 1;
  transform: translateY(0);
}

.ai-video-card-feature:hover {
  background: var(--video-yellow);
  color: var(--video-yellow-text);
}

.ai-video-card-cover-img {
  z-index: 0;
}

.ai-video-card-play svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
  margin-left: 2px;
}

.ai-video-card-body {
  display: flex;
  flex-direction: column;
  padding: 11px 12px 13px;
}

.ai-video-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 8px;
}

.ai-video-card-meta span {
  min-height: 23px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 8px;
  background: var(--video-soft);
  color: var(--video-muted);
  font-size: 12px;
  font-weight: 850;
}

.ai-video-card h3 {
  height: 58px;
  margin: 0;
  display: -webkit-box;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  line-height: 1.38;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.ai-video-card-creator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 7px;
  overflow: hidden;
  color: var(--video-dim);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-video-card-creator span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-video-card-creator time {
  flex: 0 0 auto;
  color: var(--video-muted);
  font-size: 11px;
  font-weight: 750;
}

.ai-video-card-admin {
  display: flex;
  gap: 7px;
  margin-top: 12px;
}

.ai-video-card-admin button {
  min-width: 0;
  height: 30px;
  flex: 1 1 0;
  border: 1px solid var(--video-line);
  border-radius: 999px;
  background: var(--video-soft);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, color .16s ease;
}

.ai-video-card-admin button:hover {
  transform: scale(1.03);
  border-color: rgba(243, 204, 79, 0.5);
  background: rgba(243, 204, 79, 0.14);
  color: var(--text);
}

.ai-video-card-admin button[data-video-delete]:hover {
  border-color: rgba(255, 93, 84, 0.52);
  background: rgba(255, 93, 84, 0.13);
}

.ai-video-card-admin button:disabled {
  cursor: wait;
  opacity: .5;
  transform: none;
}

.ai-video-play-modal {
  position: fixed;
  inset: 0;
  z-index: 9100;
  display: grid;
  place-items: center;
  padding: 24px;
}

.ai-video-play-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(12px);
}

.ai-video-play-card {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100vw - 36px));
  border: 1px solid var(--video-line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 28px 90px rgba(0,0,0,.58);
  overflow: hidden;
}

.ai-video-play-head {
  min-height: 66px;
  padding: 12px 14px 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--video-line);
}

.ai-video-play-head span {
  display: block;
  margin-bottom: 3px;
  color: var(--video-dim);
  font-size: 12px;
  font-weight: 850;
}

.ai-video-play-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 17px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.ai-video-play-head > div:first-child {
  min-width: 0;
}

.ai-video-play-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-video-play-head .ai-video-play-close {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 1px solid var(--video-line);
  border-radius: 50%;
  background: var(--video-soft);
  color: var(--text);
  font: inherit;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.ai-video-modal-favorite {
  position: static;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  color: var(--text);
  background: var(--video-soft);
  border-color: var(--video-line);
  backdrop-filter: none;
}

.ai-video-play-screen {
  background: #000;
}

.ai-video-play-screen video {
  width: 100%;
  max-height: min(72vh, 720px);
  display: block;
  background: #000;
}

.ai-video-empty {
  padding: 46px 18px;
  border: 1px solid var(--video-line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--video-muted);
  text-align: center;
  font-size: 14px;
}

.ai-video-empty strong,
.ai-video-empty span {
  display: block;
}

.ai-video-empty strong {
  margin-bottom: 8px;
  color: var(--text);
  font-size: 18px;
}

@media (max-width: 1280px) {
  .ai-video-featured {
    grid-template-columns: 1fr;
  }

  .ai-video-featured-info {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    align-items: center;
    column-gap: 18px;
    border-left: 0;
    border-top: 1px solid var(--video-line);
  }

  .ai-video-featured-cover-card {
    width: 120px;
    margin: 0;
  }

  .ai-video-featured-copy {
    grid-column: 2;
    grid-row: 1;
  }
}

@media (max-width: 900px) {
  .ai-video-layout {
    width: calc(100vw - 28px);
    padding-top: 50px;
    display: block;
  }

  .ai-video-creator-sidebar {
    position: static;
    max-height: none;
    padding: 14px 0;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: 0;
    border-bottom: 1px solid var(--video-line);
  }

  .ai-video-creator-home {
    width: auto;
    flex: 0 0 auto;
  }

  .ai-video-favorites-nav {
    margin-top: 0;
  }

  .ai-video-creator-nav-label {
    display: none;
  }

  .ai-video-creator-nav {
    display: flex;
    gap: 6px;
  }

  .ai-video-creator-nav-item {
    width: 164px;
    flex: 0 0 164px;
  }

  .ai-video-creator-home.active,
  .ai-video-creator-nav-item.active {
    box-shadow: inset 0 -3px 0 var(--video-yellow);
  }

  .ai-video-card-feature {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 720px) {
  .ai-video-shell {
    width: 100%;
    padding-top: 18px;
  }

  .ai-video-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .ai-video-toolbar-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .ai-video-search {
    flex: 0 1 auto;
  }

  .ai-video-upload-btn {
    width: 100%;
    justify-content: center;
  }

  .ai-video-upload-actions {
    flex-direction: column-reverse;
  }

  .ai-video-upload-media-row {
    grid-template-columns: 1fr;
  }

  .ai-video-creator-picker,
  .ai-video-new-creator {
    grid-template-columns: 1fr;
  }

  .ai-video-creator-picker button {
    width: 100%;
  }

  .ai-video-creator-avatar-drop {
    justify-self: center;
  }

  .ai-video-upload-actions button {
    width: 100%;
  }

  .ai-video-featured-info {
    grid-template-columns: 104px minmax(0, 1fr);
    column-gap: 14px;
    padding: 14px;
  }

  .ai-video-featured-cover-card {
    width: 104px;
  }

  .ai-video-featured-info h1 {
    font-size: 18px;
  }

  .ai-video-creator-profile {
    min-height: 0;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 16px;
    padding: 8px 0 22px;
  }

  .ai-video-creator-avatar-hero {
    width: 88px;
    height: 88px;
    font-size: 28px;
  }

  .ai-video-creator-profile h1 {
    font-size: 24px;
  }

  .ai-video-card-feature {
    top: 43px;
    right: 7px;
    height: 26px;
    padding: 0 7px;
    font-size: 10px;
  }

  .ai-video-grid-head {
    align-items: center;
  }

  .ai-video-grid-head-actions {
    gap: 8px;
  }

  .ai-video-grid-sort button {
    min-width: 64px;
    padding: 0 7px;
    font-size: 11px;
  }

  .ai-video-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .ai-video-play-modal {
    padding: 12px;
  }

  .ai-video-play-card {
    width: calc(100vw - 24px);
  }

  .ai-video-play-head {
    min-height: 58px;
    padding: 10px 10px 10px 12px;
  }

  .ai-video-play-head h3 {
    font-size: 15px;
  }

  .ai-video-play-head h3 {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
}
