/* Shared video recents: image-tool twin (rail + 2-col cards). */

.vtool-suite {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin: 1.25rem 0 2rem;
}
.vtool-suite.has-recents {
  grid-template-columns: minmax(0, 1fr) minmax(248px, 320px);
}
.vtool-suite > .cvmp-wrap,
.vtool-suite > .cvid-wrap,
.vtool-suite > .grot-wrap,
.vtool-suite > .vspd-wrap,
.vtool-suite > .vloop-wrap,
.vtool-suite > .vrev-wrap,
.vtool-suite > .gmp4-wrap,
.vtool-suite > .mtool-wrap {
  margin-top: 0;
  margin-bottom: 0;
  min-width: 0;
}

.vtool-side {
  min-width: 0;
  position: sticky;
  top: 72px;
}
.vtool-suite:not(.has-recents) .vtool-side {
  display: none;
}

.vrecents-host[hidden] {
  display: none !important;
}

.vhist {
  margin: 0;
  width: 100%;
}
.vhist-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.vhist-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.vhist-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
  line-height: 1.25;
}
.vhist-hint {
  display: block;
  font-size: 0.68rem;
  font-weight: 500;
  color: #94a3b8;
  line-height: 1.3;
}
.vhist-clear {
  appearance: none;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #e8edf5;
  background: #fff;
  color: #64748b;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  line-height: 1.2;
  white-space: nowrap;
}
.vhist-clear-icon {
  display: block;
  flex-shrink: 0;
  opacity: 0.85;
}
.vhist-clear:hover {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fef2f2;
}

.vhist-list {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px;
}
.vhist-list > li {
  list-style: none !important;
  margin: 0;
  padding: 0;
}

.vhist-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding: 6px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e8edf5;
  box-sizing: border-box;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}
.vhist-item:hover {
  border-color: #e2e8f0;
  background: #f8fafc;
}

.vhist-thumb {
  position: relative;
  width: 100%;
  height: 0;
  padding: 0 0 72% 0;
  border-radius: 8px;
  overflow: hidden;
  background: #e2e8f0;
  border: 1px solid #e8edf5;
}
.vhist-thumb img,
.vhist-thumb-ph {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.vhist-thumb-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #64748b;
  background: linear-gradient(135deg, #e2e8f0 0%, #f1f5f9 100%);
}

.vhist-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.vhist-name {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  line-height: 1.3;
}
.vhist-sub {
  display: block;
  font-size: 0.64rem;
  font-weight: 500;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.vhist-actions {
  display: flex;
  width: 100%;
  gap: 6px;
  justify-content: stretch;
}
.vhist-btn {
  appearance: none;
  flex: 1 1 0;
  min-width: 0;
  min-height: 32px;
  border: 1px solid #dbe3f0;
  background: #fff;
  color: #2563eb;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 6px 4px;
  border-radius: 10px;
  cursor: pointer;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.vhist-btn:hover {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}

/* Studio / dark rails (editor, cortar, pilko) */
.vrecents-host--rail .vhist-list {
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)) !important;
}
.vrecents-host--rail .vhist-label,
.vrecents-host--rail .vhist-hint {
  color: rgba(232, 238, 246, 0.55);
}
.vrecents-host--rail .vhist-clear {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(232, 238, 246, 0.7);
}
.vrecents-host--rail .vhist-clear:hover {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(127, 29, 29, 0.25);
}
.vrecents-host--rail .vhist-item {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.09);
  box-shadow: none;
}
.vrecents-host--rail .vhist-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
}
.vrecents-host--rail .vhist-thumb {
  background: rgba(0, 0, 0, 0.25);
  border-color: rgba(255, 255, 255, 0.08);
}
.vrecents-host--rail .vhist-thumb-ph {
  color: rgba(232, 238, 246, 0.7);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
}
.vrecents-host--rail .vhist-name {
  color: #e8eef6;
}
.vrecents-host--rail .vhist-sub {
  color: rgba(232, 238, 246, 0.5);
}
.vrecents-host--rail .vhist-btn {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: #93c5fd;
}
.vrecents-host--rail .vhist-btn:hover {
  background: rgba(59, 130, 246, 0.16);
  border-color: rgba(147, 197, 253, 0.45);
  color: #bfdbfe;
}

html[data-theme="dark"] .vhist-item {
  background: #1a2030;
  border-color: #2a3344;
}
html[data-theme="dark"] .vhist-item:hover {
  background: #1c2434;
  border-color: #3a4558;
}
html[data-theme="dark"] .vhist-name {
  color: #e2e8f0;
}
html[data-theme="dark"] .vhist-clear {
  background: transparent;
  border-color: #2a3344;
  color: #94a3b8;
}
html[data-theme="dark"] .vhist-btn {
  background: #151b28;
  border-color: #2a3344;
  color: #60a5fa;
}

@media (max-width: 900px) {
  .vtool-suite,
  .vtool-suite.has-recents {
    grid-template-columns: 1fr;
  }
  .vtool-side {
    position: static;
  }
  .vhist-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .vrecents-host--side .vhist-list {
    grid-template-columns: 1fr;
  }
}
