html:has(body.video-experience-enhanced #vxProjectsDialog[open]),
body.video-experience-enhanced:has(#vxProjectsDialog[open]) {
  overflow: hidden;
}

.vx-projects {
  margin: auto;
}

.vx-projects-heading {
  min-width: 0;
}

.vx-projects-heading h2 {
  margin: 4px 0 0;
  color: #fff;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.05;
}

.vx-projects-heading p {
  max-width: 720px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.vx-projects-close {
  flex: 0 0 auto;
  opacity: .82;
}

.vx-projects #vxProjectsMount {
  padding: 22px;
}

.vx-projects .video-library {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.vx-projects .video-library-head {
  gap: 24px;
  margin-bottom: 18px;
  padding: 0 2px;
}

.vx-projects .video-hub-title {
  max-width: 720px;
}

.vx-projects .video-hub-title .badge {
  width: fit-content;
}

.vx-projects .video-hub-title h2 {
  font-size: clamp(21px, 2vw, 28px);
  line-height: 1.15;
}

.vx-projects .video-hub-title p {
  font-size: 14px;
  line-height: 1.55;
}

.video-hub-actions {
  align-items: center;
}

.video-hub-actions .library-primary-action {
  min-height: 44px;
  padding-inline: 18px;
}

.video-hub-actions .library-secondary-action {
  border-color: rgba(151, 171, 205, .28);
}

.video-hub-actions .library-utility-action {
  min-width: 0;
  padding-inline: 11px;
  color: var(--muted);
  background: transparent;
}

.vx-project-summary {
  grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(110px, 1fr));
  gap: 10px;
  padding: 18px 22px 0;
}

.vx-project-summary div {
  min-width: 0;
  min-height: 72px;
  padding: 13px 15px;
  border-radius: 8px;
  background: rgba(16, 28, 48, .72);
}

.vx-project-summary span,
.vx-project-summary strong {
  letter-spacing: 0;
}

.vx-project-summary span {
  color: #9db8ff;
  font-size: 10px;
}

.vx-project-summary strong {
  margin-top: 7px;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.3;
}

.hub-tabs {
  margin: 16px 0;
  border-radius: 8px;
}

.hub-tab {
  border-radius: 6px;
}

.library-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}

.library-summary > div {
  min-width: 0;
  min-height: 88px;
  padding: 14px 16px;
  border: 1px solid rgba(151, 171, 205, .22);
  border-radius: 8px;
  background: rgba(8, 18, 34, .68);
}

.library-summary span,
.library-summary strong {
  display: block;
  letter-spacing: 0;
}

.library-summary span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.library-summary strong {
  margin-top: 8px;
  color: #fff;
  font-size: clamp(24px, 2.3vw, 32px);
  line-height: 1;
}

.hub-action-bar {
  grid-template-columns: minmax(280px, 1fr) auto minmax(190px, 240px) auto;
  gap: 12px;
  margin-top: 0;
  padding: 14px;
  border: 1px solid rgba(151, 171, 205, .18);
  border-radius: 8px;
  background: rgba(8, 18, 34, .5);
}

.hub-action-bar label,
.hub-tools label,
.library-card > label,
.library-compact-fields label {
  letter-spacing: 0;
}

.hub-action-bar input,
.hub-action-bar select {
  min-height: 44px;
  border-radius: 6px;
}

.hub-filter-toggle,
.hub-refresh-button {
  min-height: 44px;
}

.hub-refresh-button {
  color: var(--muted);
  background: transparent;
}

.hub-filter-panel {
  margin-top: 10px;
  padding: 16px;
  border-radius: 8px;
  background: rgba(8, 18, 34, .72);
}

.hub-tools {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 0;
}

.hub-tools input,
.hub-tools select {
  min-height: 42px;
  border-radius: 6px;
}

.hub-filter-actions .btn {
  min-height: 40px;
}

.hub-filter-summary {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 6px;
  background: transparent;
}

.library-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.library-card {
  display: flex;
  min-width: 0;
  padding: 18px;
  border-radius: 8px;
  background: rgba(11, 22, 40, .78);
  border-color: rgba(151, 171, 205, .22);
  flex-direction: column;
}

.library-card-heading {
  min-height: 92px;
  margin-bottom: 12px;
}

.library-card-heading .library-card-kicker {
  display: block;
  margin: 0 0 6px;
  color: var(--green);
  font-size: 10px;
  font-weight: 950;
  line-height: 1.2;
}

.library-card-heading strong {
  margin: 0;
  color: #fff;
  font-size: 19px;
  line-height: 1.2;
}

.library-card-heading p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.library-card > label,
.library-compact-fields label {
  display: block;
  margin: 0 0 5px;
  color: #9db8ff;
  font-size: 11px;
  font-weight: 900;
}

.library-card input,
.library-card select {
  min-height: 42px;
  margin-bottom: 11px;
  border-radius: 6px;
}

.library-compact-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.library-check {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-height: 44px;
  margin: 4px 0 14px;
  padding: 10px;
  border: 1px solid rgba(151, 171, 205, .2);
  border-radius: 6px;
  color: #dce8ff;
  cursor: pointer;
}

.library-check input {
  width: 20px;
  height: 20px;
  min-height: 0;
  margin: 0;
  accent-color: var(--green);
}

.library-check span {
  font-size: 12px;
  line-height: 1.45;
}

.library-check:focus-within {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.library-card-submit {
  width: fit-content;
  min-height: 42px;
  margin-top: auto;
}

.library-list {
  gap: 12px;
  margin-top: 18px;
}

.library-item {
  grid-template-columns: 154px minmax(0, 1fr) minmax(150px, auto);
  gap: 18px;
  align-items: stretch;
  padding: 16px;
  border-radius: 8px;
  background: rgba(10, 20, 37, .84);
  border-color: rgba(151, 171, 205, .2);
}

.library-item:hover {
  border-color: rgba(151, 171, 205, .36);
}

.library-item > * {
  min-width: 0;
}

.library-thumb {
  width: 154px;
  aspect-ratio: 16 / 10;
  height: auto;
  align-self: start;
  border-radius: 6px;
  object-fit: cover;
}

.library-item-content {
  display: flex;
  flex-direction: column;
}

.library-item-identity strong {
  color: #fff;
  font-size: 17px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.library-item-identity span {
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.45;
}

.library-state {
  order: -1;
  margin: 0 0 10px;
}

.library-chip {
  min-height: 24px;
  border-radius: 999px;
  letter-spacing: 0;
}

.library-chip-primary {
  color: var(--green);
}

.library-chip-secondary {
  color: #c6d4ed;
  border-color: rgba(151, 171, 205, .2);
  background: rgba(151, 171, 205, .08);
}

.library-meta {
  margin-top: 10px;
}

.library-meta b {
  min-height: 24px;
  padding: 4px 8px;
  color: #cbd9ef;
  background: rgba(151, 171, 205, .07);
}

.library-item-facts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.library-item-facts > span {
  min-width: 92px;
  margin: 0;
  padding: 7px 9px;
  border-left: 2px solid rgba(47, 145, 255, .5);
  background: rgba(47, 145, 255, .05);
}

.library-item-facts small,
.library-item-facts strong {
  display: block;
  letter-spacing: 0;
}

.library-item-facts small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.library-item-facts strong {
  margin-top: 3px;
  color: #fff;
  font-size: 11px;
  line-height: 1.25;
}

.library-notice {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 198, 77, .24);
  border-radius: 6px;
  background: rgba(255, 198, 77, .06);
}

.library-notice b,
.library-notice span {
  margin: 0;
  color: #ffe28a;
  font-size: 10px;
  line-height: 1.35;
}

.library-progress-wrap {
  display: grid;
  grid-template-columns: minmax(90px, auto) minmax(120px, 1fr);
  gap: 10px;
  align-items: center;
  margin-top: auto;
  padding-top: 12px;
}

.library-progress-wrap > span {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.library-item .library-progress {
  min-width: 0;
  margin: 0;
}

.library-inline-error {
  margin-top: 8px !important;
  color: #ff9db4 !important;
  line-height: 1.4;
}

.library-actions {
  display: flex;
  min-width: 150px;
  gap: 10px;
  justify-content: flex-start;
  flex-direction: column;
}

.library-actions .library-item-primary {
  width: 100%;
  min-height: 44px;
}

.library-item-secondary {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.library-item-secondary > .btn,
.library-item-secondary > .library-menu-wrap {
  flex: 1 1 auto;
}

.library-item-secondary .btn {
  width: 100%;
}

.library-menu-wrap {
  min-width: 88px;
}

.library-menu {
  border-radius: 8px;
}

.library-menu .btn {
  min-height: 40px;
}

.library-job {
  margin-top: 14px;
  border-radius: 6px;
}

.archive-empty.library-empty-state {
  display: flex;
  min-height: 250px;
  padding: 30px;
  border: 1px dashed rgba(151, 171, 205, .34);
  border-radius: 8px;
  text-align: center;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.library-empty-icon {
  display: grid !important;
  width: 48px;
  height: 48px;
  margin: 0 0 14px !important;
  border: 1px solid rgba(0, 245, 160, .4);
  border-radius: 50%;
  color: var(--green) !important;
  font-size: 28px !important;
  place-items: center;
}

.library-empty-state strong {
  font-size: 19px;
}

.library-empty-state > span:not(.library-empty-icon) {
  max-width: 560px;
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.5;
}

.library-empty-state .hero-actions {
  justify-content: center;
  margin-top: 18px;
}

.library-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
  padding: 14px 0 2px;
  border-top: 1px solid rgba(151, 171, 205, .18);
}

.library-pagination[hidden] {
  display: none;
}

.library-pagination span {
  min-width: 100px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.library-loading {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 10px 16px;
  align-items: center;
  min-height: 116px;
  padding: 16px;
  border: 1px solid rgba(151, 171, 205, .18);
  border-radius: 8px;
  background: rgba(8, 18, 34, .5);
}

.library-loading span {
  height: 13px;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(151, 171, 205, .1), rgba(151, 171, 205, .24), rgba(151, 171, 205, .1));
  background-size: 200% 100%;
  animation: library-loading 1.2s linear infinite;
}

.library-loading span:first-child {
  grid-row: 1 / span 3;
  height: 78px;
}

.library-loading strong {
  grid-column: 2;
  color: var(--muted);
  font-size: 12px;
}

.vx-projects button:focus-visible,
.vx-projects input:focus-visible,
.vx-projects select:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

@keyframes library-loading {
  to { background-position: -200% 0; }
}

@media (max-width: 1100px) {
  .hub-tools {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .library-item {
    grid-template-columns: 126px minmax(0, 1fr);
  }

  .library-thumb {
    width: 126px;
  }

  .library-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(180px, .55fr) 1fr;
    align-items: center;
  }
}

@media (max-width: 820px) {
  .vx-projects #vxProjectsMount {
    padding: 14px;
  }

  .vx-project-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 14px 14px 0;
  }

  .library-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .library-summary > div:last-child {
    grid-column: 1 / -1;
  }

  .hub-action-bar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .hub-search-field {
    grid-column: 1 / -1;
  }

  .hub-sort-field {
    grid-column: 1;
  }

  .hub-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .library-grid {
    grid-template-columns: 1fr;
  }

  .library-card-heading {
    min-height: 0;
  }
}

@media (max-width: 560px) {
  .vx-projects > header {
    align-items: flex-start;
    padding: 14px max(12px, env(safe-area-inset-right)) 14px max(12px, env(safe-area-inset-left));
  }

  .vx-projects-heading h2 {
    font-size: 27px;
  }

  .vx-projects-heading p {
    font-size: 12px;
  }

  .vx-projects-close {
    min-height: 42px;
  }

  .vx-projects #vxProjectsMount {
    padding: 10px max(10px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  }

  .vx-projects .video-library-head {
    gap: 14px;
  }

  .video-hub-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .video-hub-actions .library-primary-action {
    grid-column: 1 / -1;
    width: 100%;
  }

  .video-hub-actions .library-utility-action {
    width: 100%;
  }

  .hub-tabs {
    top: 0;
    z-index: 5;
    margin-inline: -2px;
  }

  .library-summary {
    gap: 8px;
  }

  .library-summary > div {
    min-height: 76px;
    padding: 12px;
  }

  .library-summary strong {
    font-size: 25px;
  }

  .hub-action-bar {
    grid-template-columns: 1fr 1fr;
    padding: 10px;
  }

  .hub-search-field {
    grid-column: 1 / -1;
  }

  .hub-filter-toggle,
  .hub-refresh-button {
    width: 100%;
  }

  .hub-sort-field {
    grid-column: 1 / -1;
  }

  .hub-tools {
    grid-template-columns: 1fr;
  }

  .hub-filter-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .hub-filter-actions .btn {
    width: 100%;
  }

  .hub-filter-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .library-card {
    padding: 14px;
  }

  .library-compact-fields {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .library-card-submit {
    width: 100%;
  }

  .library-item {
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 11px;
    padding: 12px;
  }

  .library-thumb {
    width: 84px;
  }

  .library-state {
    grid-column: 1 / -1;
  }

  .library-item-identity strong {
    font-size: 15px;
  }

  .library-item-facts,
  .library-meta,
  .library-notice,
  .library-progress-wrap {
    grid-column: 1 / -1;
  }

  .library-item-facts > span {
    flex: 1 1 120px;
  }

  .library-progress-wrap {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .library-actions {
    grid-column: 1 / -1;
    display: flex;
    width: 100%;
  }

  .library-item-secondary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .library-menu-wrap {
    min-width: 0;
  }

  .library-menu {
    right: 0;
    left: auto;
    width: min(260px, calc(100vw - 38px));
  }

  .archive-empty.library-empty-state {
    min-height: 230px;
    padding: 22px 14px;
  }

  .library-empty-state .hero-actions {
    display: grid;
    width: 100%;
  }

  .library-pagination {
    justify-content: space-between;
  }

  .library-loading {
    grid-template-columns: 78px 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .library-loading span {
    animation: none;
  }
}
