html, body {
  height: 100dvh;
  margin: 0;
  overflow: hidden;
}
.popup {
  height: 100dvh;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-container-high) transparent;
}
.popup::-webkit-scrollbar {
  width: 6px;
}
.popup::-webkit-scrollbar-track {
  background: transparent;
}
.popup::-webkit-scrollbar-thumb {
  background: var(--surface-container-high);
  border-radius: 3px;
}
.popup::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
.popup header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.popup header h4 {
  margin: 0;
  font-size: 20px;
}
.popup .brand {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: var(--track-mono);
  color: var(--text-muted);
  text-transform: uppercase;
}
.popup .import-row {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.popup .import-row .input {
  flex: 1;
}
.popup #pl-list {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-container-high) transparent;
}
.popup #pl-list::-webkit-scrollbar {
  width: 6px;
}
.popup #pl-list::-webkit-scrollbar-track {
  background: transparent;
}
.popup #pl-list::-webkit-scrollbar-thumb {
  background: var(--surface-container-high);
  border-radius: 3px;
}
.popup #pl-list::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
.popup .playlist {
  display: flex;
  gap: 10px;
  padding: 8px;
  border: 2px solid var(--border-primary);
  background: var(--surface-container-low);
  text-decoration: none;
  color: inherit;
}
.popup .playlist img {
  width: 72px;
  height: 40px;
  object-fit: cover;
  border: 2px solid var(--border-primary);
  flex-shrink: 0;
}
.popup .playlist .meta {
  flex: 1;
  min-width: 0;
}
.popup .playlist .title {
  font-weight: 600;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.popup .playlist .sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.popup .focus-on {
  background: var(--primary-container);
  color: var(--on-primary-container);
  border-color: var(--border-primary);
}
.popup .link-row {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.popup .link-row .btn {
  flex: 1;
  padding: 8px 10px;
  font-size: 13px;
}
.popup .signin {
  text-align: center;
  padding: 24px 8px;
}
.popup .error {
  color: var(--error-container);
  font-size: 12px;
}

/* Active playlist video list */
.popup .pl-active {
  flex-shrink: 0;
  border: 2px solid var(--border-primary);
  background: var(--surface-container-low);
}
.popup .pl-active-header {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-primary);
}
.popup .pl-active-title {
  font-weight: 700;
  font-size: 13px;
}
.popup .pl-active-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.popup .pl-videos {
  max-height: 300px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-container-high) transparent;
}
.popup .pl-videos::-webkit-scrollbar {
  width: 5px;
}
.popup .pl-videos::-webkit-scrollbar-track {
  background: transparent;
}
.popup .pl-videos::-webkit-scrollbar-thumb {
  background: var(--surface-container-high);
  border-radius: 3px;
}
.popup .pl-video {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 12px;
  border-bottom: 1px solid var(--outline);
}
.popup .pl-video:last-child {
  border-bottom: none;
}
.popup .pl-video:hover {
  background: var(--surface-container-high);
}
.popup .pl-video.current {
  background: var(--primary-container);
  color: var(--on-primary-container);
}
.popup .pl-cb {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  cursor: pointer;
}
.popup .pl-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
  color: inherit;
}
.popup .pl-video.current .pl-title {
  color: var(--on-primary-container);
}
